Chapter 4
4.2. - Network Layer:
Internet Protocol
4.2.1
4.2-1 INTERNETWORKING
Internetworking: connecting networks
together to make an internetwork or an Internet.
Topics discussed in this section:
Need for Network Layer
Internet as a Datagram Network
Internet as a Connectionless Network
4.2.2
Figure 4.2.1 Links between two hosts
4.2.3
Figure 4.2.2 Network layer in an internetwork
4.2.4
Figure 4.2.3 Network layer at the source, router, and destination
4.2.5
Figure 4.2.3 Network layer at the source, router, and destination (continued)
4.2.6
Switching at the network layer in the
Internet uses the datagram approach to
packet switching.
Communication at the network layer in
the Internet is connectionless.
4.2.7
4.2-2 IPv4
The Internet Protocol version 4 (IPv4) is the delivery
mechanism used by the TCP/IP protocols.
Topics discussed in this section:
Datagram
Fragmentation
Checksum
Options
4.2.8
Figure 4.2.4 Position of IPv4 in TCP/IP protocol suite
4.2.9
Figure 4.2.5 IPv4 datagram format
4.2.10
Figure 4.2.6 Service: Service type or differentiated services
Previous Current
4.2.11
Table 4.2.1 Types of service
4.2.12
Table 4.2.2 Default types of service
4.2.13
Table 4.2.3 Values for codepoints
4.2.14
Figure 4.2.7 Encapsulation of a small datagram in an Ethernet frame
4.2.15
Figure 4.2.8 Protocol field and encapsulated data
4.2.16
Table 4.2.4 Protocol values
4.2.17
Example 4.2.1
An IPv4 packet has arrived with the first 8 bits as shown:
01000010
The receiver discards the packet. Why?
Solution
There is an error in this packet. The 4 leftmost bits (0100)
show the version, which is correct (4= IPv4, 6= IPv6).
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.
4.2.18
Example 4.2.2
In an IPv4 packet, the value of HLEN is 1000 in binary.
How many bytes of options are being carried by this
packet?
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.
4.2.19
Example 4.2.3
In an IPv4 packet, the value of HLEN is 5, and the value
of the total length field is 0x0028. How many bytes of
data are being carried by this packet?
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).
4.2.20
Example 4.2.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.
4.2.21
Figure 4.2.9 Maximum transfer unit (MTU)
4.2.22
Phân mảnh gói tin:
o Trường nhận dạng: 16 bit, nhận dạng gói tin được tạo ra từ
nguồn, là duy nhất được copy vào tất cả các mảnh, giúp đích
tổng hợp lại gói tin
o Cờ: 3 bit,
Bit đầu tiên không sử dụng,
Bit thứ 2 (D): không phân mảnh, nếu nó bằng 1 thì nút không
phải phân mảnh gói tin, nếu nó bằng 0 thì có thể phân mảnh nếu
cần
Bit cuối cùng (M): 1 tức là không phải mảnh cuối, 0 có nghĩa là
mảnh cuối hoặc chỉ có 1 mảnh
23
Phân mảnh gói tin:
o Offset: 13 bit cho biết vị trí tương đối của mảnh so
với toàn bộ gói tin
o Được đo theo đơn vị 8 byte
24
25
Phân mảnh và Hợp nhất Gói tin IP
26
Table 4.2.5 MTUs for some networks
4.2.27
Other fields of IP header: Textbook
4.2.28
4.2-3 IPv6
•The network layer protocol in the TCP/IP protocol
suite is currently IPv4.
•Although IPv4 is well designed, data communication
has evolved since the inception of IPv4 in the 1970s.
•IPv4 has some deficiencies that make it unsuitable for
the fast-growing Internet.
Topics discussed in this section:
Advantages
Packet Format
Extension Headers
4.2.29
Figure 4.2.15 IPv6 datagram header and payload
4.2.30
Figure 4.2.16 Format of an IPv6 datagram
4.2.31
Table 4.2.6 Next header codes for IPv6
4.2.32
Table 4.2.7 Priorities for congestion-controlled traffic
4.2.33
Table 4.2.8 Priorities for noncongestion-controlled traffic
4.2.34
Table 4.2.9 Comparison between IPv4 and IPv6 packet headers
4.2.35
Figure 4.2.17 Extension header types
4.2.36
Table 4.2.10 Comparison between IPv4 options and IPv6 extension headers
4.2.37
4.2-4 TRANSITION FROM IPv4 TO IPv6
Because of the huge number of systems on the
Internet, the transition from IPv4 to IPv6 cannot
happen suddenly. It takes a considerable amount of
time before every system in the Internet can move from
IPv4 to IPv6. The transition must be smooth to prevent
any problems between IPv4 and IPv6 systems.
Topics discussed in this section:
Dual Stack
Tunneling
Header Translation
4.2.38
Figure 4.2.18 Three transition strategies
4.2.39
Figure 4.2.19 Dual stack
4.2.40
Figure 4.2.20 Tunneling strategy
4.2.41
Figure 4.2.21 Header translation strategy
4.2.42
Table 4.2.11 Header translation
4.2.43