Sie sind auf Seite 1von 47

Chapter 20 Network Layer: Internet Protocol

20.1

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

20-1 INTERNETWORKING
In this section, we discuss 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
20.2

Figure 20.1 Links between two hosts

20.3

Need for network Layer

When frames come to the switch it does not know which interface to go. Data link layer has no routing table. The destination address is local in data link layer.

20.4

Figure 20.2 Network layer in an internetwork

20.5

Figure 20.3 Network layer at the source, router, and destination

The source check its routing table to find the routing info. (outgoing interface, physical address). If the packet is too large, it will be fragmented. The destination is responsible for address verification and if the packet is fragmented, the network layer must reassembly

20.6

Figure 20.3 Network layer at a router

20.7

Internet

Switching at the network layer in the Internet uses the datagram approach to packet switching. Communication in the network layer in the internet is connectionless (best effort).

20.8

20-2 IPv4
The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the TCP/IP protocols. IPv4 is a best-effort delivery service (no guarantee). There is no error and flow control. Topics discussed in this section:
Datagram Fragmentation Checksum Options
20.9

Figure 20.4 Position of IPv4 in TCP/IP protocol suite

20.10

Figure 20.5 IPv4 datagram format

If a machine uses different protocol version then the datagram is discarded (rather than incorrectly interpreted) Header length is needed because it is variable. It specifies the length in a unit of 4 bytes. TTL specifies the maximum number of hops visited by the datagram. Each router decrements this number by 1. When the value is zero , the router discards the datagram TTL is used to prevent datagrams that travels in network for a long time without ever getting delivered

20.11

Figure 20.6 Service type or differentiated services

Precedence defines the priority (0-7) when there is congestion. Datagram with lowest priority is discarded first. Datagram used for management should get higher priority. Precedence subfield is never used. Application programs can request for specific type of services (table next slide). Codepoint: - when 3 rigthmost bits are all 0s, the 3 leftmost bits are interpreted the same as precedence. - when 3 rigthmost bits are not all 0s, the 6 bits define 64 services based on the priority assignment by Internet authority or local authority. 1. xxxxx0 assigned by internet authority 2. xxxx11 assigned by local authority 3. xxxx01 assigned for experimental purposes.

20.12

Table 20.2 Default types of service

20.13

Note

The total length field defines the total length of the datagram including the header.

20.14

Figure 20.7 Encapsulation of a small datagram in an Ethernet frame

Total length is needed when padding is used in the data link layer to determine how much data is contained in the frame.

20.15

Example 20.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. 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.
20.16

Example 20.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.

20.17

Example 20.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).

20.18

Example 20.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-tolive 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.
20.19

Figure 20.9 Maximum transfer unit (MTU)

Because a datagram may travel through different networks with different link layer protocols and different frame sizes, fragmentation may be needed to fit the IP datagram into a smaller frame size. MTU defines the maximum size of the data field in a specific data link protocol.

20.20

Table 20.5 MTUs for some networks

20.21

Fragmentation

Fragmentation can be performed at the source host or any router in the path. Only the final destination host can reassemble the fragmented datagrams. A datagram can be fragmented as many times as needed. Identification helps the destination to reassemble the datagram. IPv4 uses counter to label the datagrams. When sending a datagram, IPv4 copies current value of the counter to the identification field and increase the counter by 1. Combination of identification and source IPv4 address must uniquely define a datagram. If do not flag is 1 and the machine cannot pass the datagram without fragmentation, it will discard. more fragments equal to 0 means this is the last or the only fragment. Fragment offset show relative position of this fragment with respect to the whole datagram. The offset is in unit of 8 bytes. (next slide)

20.22

Figure 20.11 Fragmentation example

Suppose a datagram is 4000 bytes in lengths. We want to divide into three fragments. First and second fragments have 1400 bytes each and the third one has 1200 bytes.

20.23

Figure 20.12 Detailed fragmentation example

20.24

Example 20.5
A packet has arrived with an M bit value of 0. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented? 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.

20.25

Example 20.6
A packet has arrived with an M bit value of 1. Is this the first fragment, the last fragment, or a middle fragment? Do we know if the packet was fragmented? 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 dont know if it is the first one or a middle one; we need more information (the value of the fragmentation offset).
20.26

Example 20.7
A packet has arrived with an M bit value of 1 and a fragmentation offset value of 0. Is this the first fragment, the last fragment, or a middle fragment? 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.

20.27

Example 20.8
A packet has arrived in which the offset value is 100. What is the number of the first byte? Do we know the number of the last byte? 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.

20.28

Example 20.9
A packet has arrived in which the offset value is 100, the value of HLEN is 5, and the value of the total length field is 100. What are the numbers of the first byte and the last byte? 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.
20.29

Example 20.10
Figure 20.13 shows an example of a checksum calculation for an IPv4 header without options. The header is divided into 16-bit sections. All the sections are added and the sum is complemented. The result is inserted in the checksum field.

20.30

Figure 20.13 Example of checksum calculation in IPv4


Checksum field is 16 bits in length. Checksum is based on hexadecimal numbers. Checksum is the complemented sum result. Checksum is only performed for the header to save the processing time.

20.31

Figure 20.14 Taxonomy of options in IPv4

Options can be 40 bytes maximum. No-operation --1 byte option used as a filler between options End-of-option used for padding at the end of option field Record route to record the routers that handle the datagram (for debugging purpose) Strict source route to predetermine the routers that the datagram must visit so that sender can choose route with minimum delay, max throughput, etc.. Loose source route -- less rigid, the datagram can also visit other routers. Timestamp record the time of datagram processing by a router, expressed in ms form midnight GMT, help tracking behaviors of routers.

20.32

20-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
20.33

Advantage of IPv6
Larger address space 128 bits against 32 bits. Better header format simplifies and speed up routing process. New options allow additional functionalities Allowance for extension IPv6 allows extension of the protocol. Support resource allocation flow label mechanism can be used to support real-time applications. Support more security IPv6 has encryption and authentication.

20.34

Figure 20.15 IPv6 datagram header and payload

20.35

Figure 20.16 Format of an IPv6 datagram


Priority IPv6 divides traffics into two categories - congestion-controlled traffic is used mostly with applications that can tolerate a few delays, lost, or out-of-order

- noncongestion-controlled traffic is the applications such real-time video that cannot tolerate delays, lost, or out-of-order . Priorities are assigned based on how much redundancy is in the data.

20.36

Figure 20.16 Format of an IPv6 datagram


Flow label A flow is a sequence of packets that share the same characteristics, such as traveling the same path, using the same resources, having the same kind of security, etc. A router that supports the handling of flow label has a flow label table. The table has an entry for each flow label; each entry defines the services required by the corresponding flow. When router receives a packet with flow label, it consults flow table then provided the packet with the services mentioned in the entry. Flow label can speed up the processing of a packet by a router. Real-time process can make reservation for BW, buffer, or other resources beforehand to guarantee that real-time data will not be delayed. Rules 1. Flow label is assigned to a packet by the source. 2. If a host does not support, this field is set to 0. If a router does not support, it will ignore. 3. All packet with the same flow have the same source, dest, priority, and options.

20.37

Figure 20.16 Format of an IPv6 datagram


Next header defines the header that follows the base header. Next header can be optional extension header or the header of the encapsulated packet such as UDP or TCP. Next header field is the protocol field in IPv4.

20.38

Table 20.9 Comparison between IPv4 and IPv6 packet headers

20.39

Figure 20.17 Extension header types

Hop-by-hop used when the source needs to pass info to all routers visited by the datagram. Source routing similar to IPv4. Fragmentation only original source can fragment. A source must use path MTU discovery technique to find the smallest MTU supported by any network on the path, then fragment. Authentication validate the sender to ensure integrity of the data. Destination option used when the source needs to pass info to the destination only. Intermediate routers are not allowed to access this info.

20.40

Table 20.10 Comparison between IPv4 options and IPv6 extension headers

20.41

20-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
20.42

Figure 20.18 Three transition strategies

20.43

Figure 20.19 Dual stack

A station must run IPv4 and IPv6 simultaneously

20.44

Figure 20.20 Tunneling strategy

When two computers with IPv6 want to communicate and the packet must pass through a region using IPv4. IPv6 packet is encapsulated in IPv4 packet and leaves its capsule when exiting the region. To make clear that the IPv4 is carrying an IPv6 packet as data, the protocol value is set to 41.

20.45

Figure 20.21 Header translation strategy

20.46

HW # 6

EE5360 spring 2013

Assigned Date: 3/26/2013 Ch: 19 Prob:3, 5, 7, 16, 17, 18, 19, 20, 21, 23, 24, 25, 29, 30. Due Date: 4/2/2013

20.47

Das könnte Ihnen auch gefallen