CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

71
CSIT 220 (Blum) 1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

Transcript of CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

Page 1: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 1

IP Datagram

Based on Chapter 20 of Computer Networks and Internets (Comer)

Page 2: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 2

Overall Goal Recall that our overall goal is to exchange

information between applications running on different hosts in such a way that the applications require no knowledge of the details of the underlying connection. Information hiding

This goal is achieved using a protocol suite which takes a layered approach — defining services and functions for each layer.

Page 3: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 3

Connection-Oriented or Connectionless The two basic types of service are

connection-oriented (establish a dedicated path) connectionless (each packet finds its own way)

TCP/IP provides (in some sense) both. The basic delivery system (IP) is connectionless. A verification scheme (TCP) provides some of

the reliability features of a connection-oriented service.

Page 4: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 4

Hop-to-hop Connectionless service is an extension of the packet

switching idea. Packets can travel independently since each contains

its destination address as part of the header. A local network uses the physical address added at

Network Interface Layer (a.k.a Data Link) to deliver the packet to its local destination, which may be The final destination (a host on the local network) A router which will place the packet on an adjoining

network

Page 5: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 5

Virtual and Universal Two interconnected networks can use different

protocols at the lowest layers (for instance, Ethernet and FDDI), but at the IP layer this specific/heterogeneous information is stripped off and the packet becomes independent of the network it arrived on.

At the IP layer, the packets might be called Virtual: not physical, software-based Universal: characteristic of all, as opposed to specific to

one or a few

Page 6: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 6

Heterogeneous LAN information is stripped off at Data-Link layer before the packet is handed up to Network Layer.

Page 7: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 7

IP Datagram A datagram is “a self-contained, independent

entity of data carrying sufficient information to be routed from the source to the destination computer without reliance on earlier exchanges between this source and destination computer and the transporting network.” Internet’s Request for Comments (RFC) 1594

Page 8: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 8

Datagram Packet The term “datagram” has become synonymous with

the term “packet.” A packet should be

Independent of the specifics of the network it is on Independent of the specifics of the path it has traveled thus

far Understandable to any router along the way or the

destination host’s IP layer The information regarding the packet’s destination

and interpretation is in its header. The data portion which follows is variable in size.

Page 9: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 9

Datagram Paths A router reads the IP address, calculates the network

portion of that IP address, looks up that value in its routing table and then sends the packet to the next router (or to the host if it is local).

The destination field in the packet contains the destination address. The router uses its Mask to calculate the network address for the Next Hop (Router destination).

The Mask is a set of bits which are ANDed with the destination address to produce the destination network address.

Page 10: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 10

R2’s Routing Table

Page 11: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 11

R2’s Routing Table

The IP addresses must of course be resolved into physical address for actual transmission to take place

R2

Page 12: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 12

Best-Effort Delivery The IP protocol makes a “best-effort” to deliver the

packets. It does NOT handle datagram duplication (because of retransmission) delayed or out-of-order delivery corruption of data datagram loss

These errors are handled by higher layers of the stack. TCP handles these errors UDP ignores most of these errors

Page 13: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 13

Header Format

Indicates the version of IP being used (typically version 4)

Page 14: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 14

Header Format

Indicates how big the header is, i.e. how many groups of 32. It is usually 5, since options are rare.

Page 15: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 15

Header Format

Indicates how packet should be sent, to minimize delay, maximize throughput, etc.

Page 16: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 16

Type of Service

Page 17: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 17

Header Format

Indicates the total length of the packet: how many octets. Can be up to 65535, but packets are rarely that large.

Page 18: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 18

Header Format

Discussed in the second part of lecture

Page 19: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 19

Header Format

How many hops the packet is allowed before it cannot continue, (between 1 and 255)

Page 20: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 20

Header Format

Deliver to UDP, TCP, etc

Page 21: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 21

Types or Protocols

Page 22: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 22

Header Format

Checks for errors in the header information, by adding all of the 16-bit numbers

Page 23: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 23

Header Format

IP address of source, 32 bits in IP(v4)

Page 24: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 24

Header Format

IP address of destination, 32 bits in IP(v4)

Page 25: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 25

Header Format

Allows optional information to be conveyed, header length indication whether or not the packet has an optional part

Page 26: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 26

Header Format

Header is multiple of 32 bits, padding is 0’s to get length to work out to correct length

Page 27: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 27

Header Format

And last but not least, the data

Page 28: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 28

Terms In a Datagram Header

Service Type Three bits are used to set a priority 0-7 which indicate

whether the packet can jump ahead in a queue at certain routers Most routers ignore priority

Can indicate that packet is small but should get through quickly (e.g. when one is telneting)

Can indicate that many large packets are coming and a high-throughput path should be used

Can specify that the most reliable path should be used

Page 29: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 29

Terms In a Datagram Header Total Length

total number of octets in datagram including header and data

Time to Live prevents a datagram from traveling forever around a path

that contains a loop. This defines the maximum number of hops. Each router that encounters the packet decrements the count by 1. The routers should eliminate loops but there may be a problem

Header Checksum used to test accuracy of header bits. Does not check data.

Page 30: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 30

tracert

Page 31: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 31

Tracert and TTL

The TTL field plays an important role in the tracert utility.

The first packet is transmitted with a TTL of 1, when the router reached after one hop is reached, it decrements the TTL to give 0. When this happens, the router drops the packet and send a special message – an Internet Control Message Protocol (ICMP) message back to source. And the source now knows the IP address of the first hop node.

It then issues a packet with a TTL of 2, …

Page 32: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 32

Variable in size The data portion of an IP datagram (packet) is

variable in size. The data portion can be as small as a single

octet (byte). The largest IP packet possible is 64K octets

(this includes the header portion). We’ll save the question about overhead for

the homework.

Page 33: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 33

Encapsulation, Fragmentation and Reassembly and IP(v6)

Based on Chapters 21 and 22 in Computer Networks and Internets (Comer)

Page 34: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 34

Encapsulation Encapsulation is the inclusion of one thing

inside another, a capsule. The outside world deals only with the capsule and not with what is contained in the capsule.

Decapsulation is the removal of the object from the capsule.

Page 35: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 35

Encapsulation (Cont.) When one attaches an Ethernet header and trailer to

an IP packet, one is encapsulating the IP packet. Until it is “decapsulated,” it will be treated as an

Ethernet packet without regard for what it contains. The same IP packet can be encapsulated in an

Ethernet frame or in a FDDI frame. Different types of packets (IP or Novell’s IPX) can

be put into the same type of capsule (e.g. Ethernet).

Page 36: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 36

Page 37: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 37

Transmission Across the Internet When an encapsulated frame reaches a router or

destination host, the Layer 2 header is stripped off (decapsulation), exposing the IP datagram.

If the datagram needs to be forwarded to another router, the current router adds a new Ethernet header (or whatever frame protocol is used on the next hop) and sends the new frame to the next hop.

IP Datagrams are stored in host and router memory without the frame headers. The frame headers are used only to send the IP Datagram across the physical network.

Page 38: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 38

Encapsulating an IP packet

Ethernet has a trailer too

Making a packet the data field of a larger packet/frame.

Page 39: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 39

Ethernet capsule

Physical address obtained from an ARP

Indicates what kind of thing is encapsulated

The encapsulated data

Page 40: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 40

Ethernet Frame Types

Page 41: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 41

Frame format and size depends on the network (Ethernet, FDDI, etc.)

Page 42: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 42

MTU Maximum Transmission Unit: the largest

physical packet size, measured in bytes, that a network can transmit. On an Ethernet LAN, the MTU is 1500 bytes,

the maximum number of data (payload) bytes in an Ethernet frame

Any messages larger than the MTU are divided into smaller packets (fragments) before being sent.

Page 43: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 43

MTU (Cont.) Different physical networks have different MTUs.

The MTU may also be set by the network administrator.

If the source computer transmits packets that are too large for some network encountered on the way to its destination, then a router will break the packet into smaller packets (fragmenting).

Ideally, the source computer should transmit packets that do not require the router to fragment them as this can result in the delay or loss of packets.

Page 44: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 44

A situation requiring fragmentation

If Host 1 transmits a 1500-byte IP datagram destined for Host 2, it will have to be fragmented when it reaches the router R.

Page 45: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 45

Fragmenting

If a packet is too big to be transmitted over a particular network, its data portion is broken into pieces and these are encapsulated in separate packets.

Page 46: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 46

MTU (Cont.) There is a setting in the registry corresponding to

MTU. Some consider it a parameter to be tweaked to improve network performance.

“For example, the MTU of many PPP connections is 576, so if you connect to the Internet via PPP, you might want to set your machine's MTU to 576 too. Most Ethernet networks, on the other hand, have an MTU of 1500 ….” (webopedia) PPP, Point-to-Point Protocol, is a way to connect a

computer to the Internet.

Page 47: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 47

Datagram Considerations If an IP datagram exceeds the MTU, it is divided

into fragments and each is sent independently. The fragments are assigned sequence numbers and

offsets. The receiver knows a frame is a fragment by a bit set in the header.

When all fragments reach the FINAL destination, they are joined to form the original datagram. This is called reassembly. Reassembly occurs only at the final destination.

Page 48: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 48

FLAGS

There’s a bit in the flag field to indicate that a packet has been fragmented.

Page 49: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 49

FRAGMENT OFFSET

Allows fragments to be reassembled in proper order.

Page 50: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 50

Reassembly Reassembly is performed by ultimate destination,

otherwise routers would have to hold on to packets to reassemble them.

Reassembly uses the sequence numbers and the offsets to rebuild the datagram.

IP does not guarantee datagram delivery. If part of a fragment is received, the destination sets a timer to receive the other pieces. If all fragments are not received within the time period, the destination can request a retransmission of the ENTIRE datagram.

Page 51: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 51

Fragment Considerations Why retransmit the entire packet? Since a new packet may follow a different

path, encountering different networks and routers, fragment sizes may vary.

Therefore the old fragments are discarded.

Page 52: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 52

IP (v6) Fragmentation/reassembly is one of the ways in

which IP(v6) differs from IP(v4). The fragmentation process itself is different (in

particular where it can occur) and so is the method of indicating that a packet has been fragmented (i.e. IP(v6) has a different header scheme).

In IP(v4) there are fixed fields found in every packet containing this information.

In IP(v6) a fragmented packet contains an extra header.

Page 53: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 53

Fragmentation header

Extra fragmentation header

Page 54: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 54

Base Header/Extension Header The creators of IP(v6) wanted to have the flexibility

of having many fields in the packet without increasing the overhead of the typical packet.

An ordinary, lone packet would have just a “base header.”

Additional information could be introduced in additional headers as needed.

Part of the header indicates whether data or another header follows it.

Page 55: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 55

Extension headers

IP(v6) allows for additional headers to be included if more information than what is contained in the base header is needed. It’s analogous to the optional field in IP(v4). It gives the protocol flexibility.

Page 56: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 56

Base Header

Indicates existence and type of next header or data

Page 57: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 57

What’s Next?

Data from higher layer (TCP) follows

Route header follows

Page 58: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 58

Another IP(v6) Fragmentation Difference

In IP(v4) a source computer or a router may fragment a message.

In IP(v6) only the source computer can fragment a message.

In order for this to be true, the source computer must know the smallest MTU along the route.

Page 59: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 59

The path MTU The source starts by sending a large packet

to the destination. If no acknowledgement is received, a

smaller packet is sent, and so on. When an acknowledgement is received,

that is the size allowed. This size is known as the path MTU.

Page 60: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 60

But what about “connectionlessness”? There is an assumption in the notion of “path

MTU” and it is that all of the packets within the fragmentation process are going to take the same path

But isn’t IP connectionless?

Page 61: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 61

It’s deja-vu all over again The creators of IP(v6) wanted to address some of

the quality of service (QoS) issues. Packets can be identified as belonging to a

particular "flow" so that packets that are part of a multimedia presentation that needs to arrive in "real time" can be provided a higher quality-of-service relative to other customers.

There are priority settings and so forth so that IP(v6) can support specified QoS levels

Page 62: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 62

Route indicator

Information about priority and so on

Page 63: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 63

Other important issues The IPv6 header now includes

extensions that allow a packet to specify a mechanism for authenticating its origin ensuring data integrity ensuring privacy

Page 64: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 64

anycast In IP(v6), anycast is communication between

a single sender and the nearest of several receivers in a group.

In a multicast, a message is sent to a set of destinations; in an anycast, a message is sent to one of a set of destinations.

Page 65: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 65

Anycast (Cont.) Anycasting is designed to let one host initiate

the efficient updating of router tables for a group of hosts. IPv6 can determine which gateway host is closest and sends the packets to that host as though it were a unicast communication. In turn, that host can anycast to another host in the group until all routing tables are updated.

Page 66: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 66

Last but not least: The 128-bit address The most noticeable difference between IP(v4) and

IP(v6) is the length of the address IP(v4) addresses consist of 32 bits 232 = 4294967296 = 4.3 109

IP(v6) addresses consist of 128 bits 2128 = 3.4 1038

In addition to supporting more addresses, IP(v6) supports more levels of hierarchy IP(v4) had two levels: network and host

Page 67: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 67

Notation

If one adopted a dotted decimal notation, an IP(v6) address would be broken down into 16 octets, e.g.

105.220.136.100.255.255.255.255.0.0.18.128.140.10.255.255

An alternative notation is the colon hexadecimal notation, which breaks the address into 8 16-bit numbers and then represents the 16-bit number as a 4-digit hexadecimal number

69DC:8864:FFFF:FFFF:0:1280:8C0A:FFFF

Page 68: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 68

Converting Two parts from the decimal dotted notation

make up one unit in “colon hex” Starting on the left, take two dotted decimal

numbers, multiply the first by 256 and add it to the second

105*256 + 220 = 27100 Convert that number to hexadecimal

Page 69: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 69

105*256 + 220

Page 70: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 70

Convert to hex

Page 71: CSIT 220 (Blum)1 IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

CSIT 220 (Blum) 71

Other References http://www.whatis.com http://www.webopedia.com Understanding Data Communications &

Networks, Shay (1999) http://www.daemon.org/ip.html