1 / 71

IP Datagram

IP Datagram. Based on Chapter 20 of Computer Networks and Internets (Comer). Overall Goal.

claricee
Download Presentation

IP Datagram

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IP Datagram Based on Chapter 20 of Computer Networks and Internets (Comer)

  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.

  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.

  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

  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

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

  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

  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.

  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.

  10. R2’s Routing Table

  11. R2’s Routing Table R2 The IP addresses must of course be resolved into physical address for actual transmission to take place

  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

  13. Header Format Indicates the version of IP being used (typically version 4)

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

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

  16. Type of Service

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

  18. Header Format Discussed in the second part of lecture

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

  20. Header Format Deliver to UDP, TCP, etc

  21. Types or Protocols

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

  23. Header Format IP address of source, 32 bits in IP(v4)

  24. Header Format IP address of destination, 32 bits in IP(v4)

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

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

  27. Header Format And last but not least, the data

  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

  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.

  30. tracert

  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, …

  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.

  33. Encapsulation, Fragmentation and Reassembly and IP(v6) Based on Chapters 21 and 22 in Computer Networks and Internets (Comer)

  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.

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

  36. 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.

  37. Encapsulating an IP packet Making a packet the data field of a larger packet/frame. Ethernet has a trailer too

  38. Ethernet capsule The encapsulated data Physical address obtained from an ARP Indicates what kind of thing is encapsulated

  39. Ethernet Frame Types

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

  41. 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.

  42. 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.

  43. 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.

  44. 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.

  45. 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.

  46. 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.

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

  48. FRAGMENT OFFSET Allows fragments to be reassembled in proper order.

  49. 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.

More Related