Академический Документы
Профессиональный Документы
Культура Документы
Internetworking Protocol
1
Main reference: Copyright © The McGraw-Hill Companies.
Part 1
6.1 Internetworking
6.2 Internet Protocol
6.3 IPv4 vs.IPv6
2
6.1: INTERNETWORKING
3
Links between two hosts
Problem: When data arrive at the interface f1 of S1, how does S1 know that
Interface f3 is the outgoing interface?
To solve this problem, the network layer was designed.
4
Network layer in an internetwork
The network layer is responsible for host-to-host delivery and for routing the packets
through the routers or switches.
5
Network layer at the source, router, and destination
Creating a packet from the data coming Address verification: ensure the destination
from another protocol. address on the packet is the same in the host.
Checking its routing to find the routing Fragmentation: waits for all fragments,
information. reassembles them and then delivers the
reassembled packet to the transport layer.
6
Network layer at the source, router, and destination (continued)
7
Note
8
Note
9
6.2: Internet Protocol
11
Position of IPv4 in TCP/IP protocol suite
Connectionless protocol for packet switching network that uses datagram approach.
Each datagram is handled independently and it can follow different route to a destination.
12
IP Addressing: IPv4
13
Network Address Classes
14
Network Classes
15
Class A
16
Class B
17
Class C
18
Class D and E
19
Network Classes
Classes can also be distinguished in decimal notation by observing the first byte:
1 to 126 Class A address
128 to 191 Class B address
192 to 223 Class C address
224 to 239 Class D address
240 to 255 Class E address
Generally, addresses should never begin with 0, 127 or any number above 223
(reserved).
Addresses violating these rules are sometimes known as Martian Address, since
these addresses are not used on earth.
20
Special Addresses
21
Special Addresses (cont …)
22
Subnetting
23
Subnetting (cont …)
Benefits
Reduced network traffic: most traffic will stay on the local network,
only packets destined for other networks will pass through routers; this
will optimize the network performance.
Simplified management: it is easier to identify and isolate network
problems in a group of smaller networks than within a large one.
24
Subnetting (cont …)
25
Subnetting (cont …)
There is only one gateway attached to the local site network that performs
internet-wide routing (communicate with outside networks).
For a single netid with a number of associated subnetworks, the hostid part
consists of 2 subfieds: subnetid and hostid,
In subnetting, bits are stolen from the hostid to create the subnetid, as shown
below.
26
Subnetting (cont …)
In the example, 6 bits are stolen from the hostid for the subnetid
Netid - defines a site
Subnetid - defines a subnetwork within a site
Hostid - identifies a host in the subnetwork
27
Masking
The part of the mask containing 1s represents the netid and subnetid
The part of the mask containing 0s identifies the hostid.
To obtain the subnet address, a bitwise-AND operation on the IP address
and the subnet mask is performed.
The effect of the subnet mask is to erase the portion of the host field that
refers to an actual host on the subnet.
What remains is the network number and the subnet number.
28
Masking (cont ..)
29
Masking (cont ..)
30
Masking (cont ..)
Hence, the datagram will be routed to LAN X which has subnet no. 1
(192.228.17.32) and received by station B (host number 25).
31
Masking (cont ..)
For each of the subnetid and hostid, all zeroes and all ones is not allowed
[reserved]
32
Masking (cont ..)
Subnet interpretation:
1) Precedence 1) Codepoint
A 3-bit subfield (0-7) When the 3 rightmost bits are 0s,
Defines the priority of the the 3 leftmost are interpreted as
datagram in issues such as the precedence bits.
congestion When the 3 rightmost bits are not
all 0s, the 6 bits define 64 services
based on the priority assignment
2) TOS bits by the Internet or local authorities.
A 4-bit subfield with each bit
having a special meaning.
Only 1 bit is set at a time
35
Note
36
Types of service
37
Default types of service
39
Note
40
Encapsulation of a small datagram in an Ethernet frame
There are occasions in which the datagram is not the only thing encapsulated
in a
frame; it may be that padding has been added.
E.g.:
41
Protocol field and encapsulated data
The 8-bit field defined the higher-level protocol that uses the services of the IPv4 layer.
A IPv4 datagram can encapsulate data from several higher-level protocol s.a TCP,
UDP etc.
Since the IPv4 protocol carriers data from different other protocols, the value of
this field helps in receiving network layer know to which protocol the data belong.
42
Protocol values
43
Example 1
Solution
There is an error in this packet. The 4 leftmost bits
(0100) show the version, which is correct. The next
4 bits (0010) show an invalid header length (2 × 4 =
8). The minimum number of bytes in the header
must be 20. The packet has been corrupted in
transmission.
44
Example 2
Solution
The HLEN value is 8, which means the total
number of bytes in the header is 8 × 4, or 32 bytes.
The first 20 bytes are the base header, the next 12
bytes are the options.
45
Example 3
Solution
The HLEN value is 5, which means the total
number of bytes in the header is 5 × 4, or 20 bytes
(no options). The total length is 40 bytes, which
means the packet is carrying 20 bytes of data (40 −
20).
Note: Length of data = total length - header length
46
Example 4
An IPv4 packet has arrived with the first few hexadecimal
digits as shown.
0x45000028000100000102 . . .
How many hops can this packet travel before being dropped?
The data belong to what upper-layer protocol?
Solution
To find the time-to-live field, we skip 8 bytes. The
time-to-live field is the ninth byte, which is 01. This
means the packet can travel only one hop. The
protocol field is the next byte (02), which means
that the upper-layer protocol is IGMP.
47
Fragmentation
Each router decapsulates the IPv4 datagram from the frame it receives, process it
and then encapsulates it in another frame.
Maximum Transfer Unit (MTU) is the maximum number of bytes that a data
link protocol can encapsulate. MTUs vary from protocol to protocol.
48
Maximum transfer unit (MTU)
49
MTUs for some networks
Flags
51
Flags used in fragmentation
52
Fragmentation example
53
Detailed fragmentation example
54
Example 5
Solution
If the M bit is 0, it means that there are no more
fragments; the fragment is the last one. However,
we cannot say if the original packet was
fragmented or not. A non-fragmented packet is
considered the last fragment.
55
Example 6
Solution
If the M bit is 1, it means that there is at least one
more fragment. This fragment can be the first one
or a middle one, but not the last one. We don’t
know if it is the first one or a middle one; we need
more information (the value of the fragmentation
offset).
56
Example 7
Solution
Because the M bit is 1, it is either the first fragment
or a middle one. Because the offset value is 0, it is
the first fragment.
57
Example 8
Solution
To find the number of the first byte, we multiply the
offset value by 8. This means that the first byte
number is 800. We cannot determine the number of
the last byte unless we know the length.
58
Example 9
Solution
The first byte number is 100 × 8 = 800. The total
length is 100 bytes, and the header length is 20
bytes (5 × 4), which means that there are 80 bytes in
this datagram. If the first byte number is 800, the
last byte number must be 879.
59
6.3: IPv6 vs IPv4
60
IPv4 vs. IPv6
61
IPv4 vs. IPv6
62
Transition From IPv4 to IPv6
63