Ref: A. Leon Garcia and I. Widjaja, Communication Networks, 2 nd Ed. McGraw Hill, 2006 Latest update of this lecture was on

Similar documents
Lecture 9: Internetworking

Chapter 5 OSI Network Layer

Position of IP and other network-layer protocols in TCP/IP protocol suite

IP : Internet Protocol

Internetwork Protocols

Introduction to Internetworking

The Internet. 9.1 Introduction. The Internet is a global network that supports a variety of interpersonal and interactive multimedia applications.

Goal of Today s Lecture. EE 122: Designing IP. The Internet Hourglass. Our Story So Far (Context) Our Story So Far (Context), Con t

CS 3516: Advanced Computer Networks

Ch.7 Internet Protocol: Connectionless Datagram Delivery (IPv4, IPv6)

Prof. Shervin Shirmohammadi SITE, University of Ottawa. Internet Protocol (IP) Lecture 2: Prof. Shervin Shirmohammadi CEG

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

Internet Networking recitation #2 IP Checksum, Fragmentation

CS 3516: Computer Networks

OSI Network Layer. Network Fundamentals Chapter 5. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Chapter 5 Network Layer

Chapter 20 Network Layer: Internet Protocol 20.1

Lecture 17 Overview. Last Lecture. Wide Area Networking (2) This Lecture. Internet Protocol (1) Source: chapters 2.2, 2.3,18.4, 19.1, 9.

Telecom Systems Chae Y. Lee. Contents. Overview. Issues. Addressing ARP. Adapting Datagram Size Notes

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

CMPE 80N: Introduction to Networking and the Internet

Introduction to TCP/IP networking

Internet Protocol. Outline Introduction to Internet Protocol Header and address formats ICMP Tools CS 640 1

The Internetworking Problem. Internetworking. A Translation-based Solution

Network Layer/IP Protocols

User Datagram Protocol

STEVEN R. BAGLEY PACKETS

b. Suppose the two packets are to be forwarded to two different output ports. Is it

Veryx ATTEST TM. Sample Test cases Overview. Conformance Test Suite. Internet Protocol version 4 (IPv4) Part Number: T / TCLS IPv /1.

Lecture 8. Network Layer (cont d) Network Layer 1-1

CSE/EE 461 The Network Layer. Application Presentation Session Transport Network Data Link Physical

Internet Protocols (chapter 18)

EP2120 Internetworking/Internetteknik IK2218 Internets Protokoll och Principer

Lecture 18 Overview. Last Lecture. This Lecture. Next Lecture. Internet Protocol (1) Internet Protocol (2)

IPv4 Lecture 10a. COMPSCI 726 Network Defence and Countermeasures. Muhammad Rizwan Asghar. August 14, 2017

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Hierarchical Routing. Our routing study thus far - idealization all routers identical network flat no true in practice. administrative autonomy

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

EE 610 Part 2: Encapsulation and network utilities

CS519: Computer Networks. Lecture 2: Feb 2, 2004 IP (Internet Protocol)

INTERNET SYSTEM. Internet Protocol. Kent State University Dept. of Computer Science. CS 4/55231 Internet Engineering. Large Scale Networking

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

ICS 451: Today's plan

The Internet Protocol (IP)

ECE 158A: Lecture 7. Fall 2015

CHAPTER-2 IP CONCEPTS

IPv6 is Internet protocol version 6. Following are its distinctive features as compared to IPv4. Header format simplification Expanded routing and

Topics for This Week

CSCI Computer Networks Fall 2016

Introduction to Internet. Ass. Prof. J.Y. Tigli University of Nice Sophia Antipolis

II. Principles of Computer Communications Network and Transport Layer

Packet Header Formats

IPv4. Christian Grothoff.

Information Network Systems The network layer. Stephan Sigg

CSCI Networking Name:

TCP /IP Fundamentals Mr. Cantu

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

Network Layer. The Network Layer. Contents Connection-Oriented and Connectionless Service. Recall:

Network Layer. Recall: The network layer is responsible for the routing of packets The network layer is responsible for congestion control

CIS-331 Final Exam Fall 2015 Total of 120 Points. Version 1

Vorlesung Kommunikationsnetze

Network Layer: Internet Protocol

ET4254 Communications and Networking 1

Tutorial 9. SOLUTION Since the number of supported interfaces is different for each subnet, this is a Variable- Length Subnet Masking (VLSM) problem.

SEMESTER 1 Chapter 5 OSI Network Layer V What services does the network layer provide?

ECE4110 Internetwork Programming. Introduction and Overview

Internetworking Terms. Internet Structure. Internet Structure. Chapter 15&16 Internetworking. Internetwork Structure & Terms

CC231 Introduction to Networks Dr. Ayman A. Abdel-Hamid. Internet Protocol Suite

Network Layer PREPARED BY AHMED ABDEL-RAOUF

ECE 4450:427/527 - Computer Networks Spring 2017

CompSci 356: Computer Network Architectures. Lecture 8: Spanning Tree Algorithm and Basic Internetworking Ch & 3.2. Xiaowei Yang

Packetization Layer Path Maximum Transmission Unit Discovery (PLPMTU) For IPsec Tunnels

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

CSCI-GA Operating Systems. Networking. Hubertus Franke

This talk will cover the basics of IP addressing and subnetting. Topics covered will include:

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

The Internet. The Internet is an interconnected collection of netw orks.

Network layer: Overview. Network Layer Functions

Network Layer: Control/data plane, addressing, routers

ICS 351: Networking Protocols

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

OSI Network Layer. Chapter 5

ECE 435 Network Engineering Lecture 12

Ch.9 Internet Protocol: Error And Control Messages (ICMP)

CIS-331 Final Exam Spring 2016 Total of 120 Points. Version 1

Introduction. IP Datagrams. Internet Service Paradigm. Routers and Routing Tables. Datagram Forwarding. Example Internet and Conceptual Routing Table

Problems of IP. Unreliable connectionless service. Cannot acquire status information from routers and other hosts

Internet Protocol (IP)

Chapter 4 Network Layer: The Data Plane. Part A. Computer Networking: A Top Down Approach

internet technologies and standards

Lesson 3. IPv4 and IPv6 Protocols. Chapter-4 L03: "Internet of Things ", Raj Kamal, Publs.: McGraw-Hill Education

Lecture 11: Fragmentation & Addressing. CSE 123: Computer Networks Stefan Savage

Internet Control Message Protocol (ICMP)

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Da t e: August 2 0 th a t 9: :00 SOLUTIONS

Goals and topics. Verkkomedian perusteet Fundamentals of Network Media T Circuit switching networks. Topics. Packet-switching networks

Lecture 8. Basic Internetworking (IP) Outline. Basic Internetworking (IP) Basic Internetworking (IP) Service Model

Internet Control Message Protocol

Network Basic v0.1. Network Basic v0.1. Chapter 3 Internet Protocol. Chapter 3. Internet Protocol

TCP/IP protocol suite

Transcription:

IP Version 4 (IPv4) Header (Continued) Identification (16 bits): One of the parameters of any network is the maximum transmission unit (MTU) parameter. This parameter specifies the maximum size of the packets that can pass through it. If a packet with size greater the MTU of a specific network needs to be transmitted over that network, it must be broken into smaller parts or otherwise it will be dropped. The Identification component of the header is used by the IP protocol whenever fragmentation (breaking the packet into smaller pieces called fragments) of a packet is performed (if fragmentation is not used, this parameter is set to 0). That is, a long packet is fragmented to smaller pieces because the network over which the packet is to be transmitted does not support the original long packet. Each fragment will be sent over the network as if it is an independent packet. Since fragments of many packets may be in transit at the same time (the different pieces of many packets are being carried over the network and have not been received yet), an identification that allows the receiving machine to know which original packet does each fragment belong to is needed. The identification will be set to a random number (one value out of a possible of 65536 values can be used) for each original packet (so all the fragments of a specific packet will have the same identification number) and this specific identification number is not used again for some time to insure that fragments of the different packets don t get mixed up (fragments of first fragmented packet with identification x do not get mixed up with fragments of second fragmented packet with the same identification x that was generated later). To avoid the mixing of fragments of packets with the same identification numbers, sufficiently long time must pass before reusing the same identification numbers again to insure that the fragments of a packet with the previous similar identification number have already been received completely or dropped. If fragments of a specific packet reach a physical network that only supports packet sizes smaller than their size, 1

these fragments will be fragmented again. The reassembling of fragments is done only at the destination machine where this machine waits until it receives all fragments of a packet and then reassembles the different components to form the original packet. Once the destination machine receives a fragment of a packet, it sets a timer. If one or more fragments of the packet are lost (they do not arrive before the timer expires), the destination machine will discard the rest of the packet. Flags (3 bits): One bit of flags is not used. Another bit of the flags is (Don t Fragment) which is used by the source machine to request from the routers carrying the packet not to fragment that packet. In this situation, if a router finds that it has to fragment a packet because the physical layer over which it will send the packet does not support the size of the packet, it will drop the packet and send back to the source an ICMP message informing it of this situation. The third bit is (More Fragments) which is used by the fragmenting machine to indicate to the destination machine if there are more fragments or not. That is, all fragments except the last one will have this bit set to 1, while the last fragment will have this bit set to 0. Fragment Offset (13 bits): The identification and Flags indicate which packet do fragments belong to and if there are more fragments coming or not. But they do not indicate the order of fragments (or the location of a fragment inside the original packet). This is done by the fragment offset, where the fragment offset represent the location of the first byte in the fragment within the data of the original packet. Since the fragment offset is 13 bits (giving 2 13 values) while the total length of the packet is 16 bits (giving 2 16 values), the fragmentation process is designed such that each fragment (except the last one) must have a size that is multiple of 8. That is, the fragment offset represents the 13 most significant bits of the location of the first byte of the fragment inside the data part of the original packet, where the 3 least significant bits are assumed to be 000. Remember that 2 16 /2 13 = 8. So, o if Fragment Offset = (0000 0000 0000 0) 2, this represents the first fragment because the first byte in the fragment is the byte (0000 0000 0000 0000) 2 in the data part of original packet. o if Fragment Offset = (0000 0000 0000 1) 2, this indicates that the first byte in the fragment is the byte (0000 0000 0000 1000) 2 = 8 in data part of the original packet. o if Fragment Offset = (0000 0000 0001 0) 2, this indicates that the first byte in the fragment is the byte (0000 0000 0001 0000) 2 = 16 in the data part of the original packet. o if Fragment Offset = (0000 0000 0001 1) 2, this indicates that the first byte in the fragment is the byte (0000 0000 0001 1000) 2 = 24 in the data part of the original packet. o And so on. The process of fragmentation and reassembling fragments is shown in the following figure. 2

In the above figure, if the Don t Fragment flag of the packets sent over Network 1 was set to logic 1, all packets will be dropped by the router and ICMP messages will be sent to the source machine. Note that a packet (or even a fragment) with a size that is smaller than or equal to the MTU of a network will not be fragmented even if its data is not a multiple of 8 (for example, if the data part of a packet is 86 bytes long (which is not a multiple of 8) and the MTU of a network allows a maximum data length of 87 bytes, this packet will be transmitted without fragmentation. This is also true if the 86 bytes was the remaining part of a packet after it was fragmented. The last fragment may have a data length of 86 bytes since there are no more fragments following it so its data length does not have to be a multiple of 8). Time to Live (8 bits): Sometimes packets get lost in the network where routers have trouble sending them to the destination, so they keep hopping from one router to another aimlessly. If a sufficient number of packets keep hopping in circles for an indefinite amount of time without aim between routers, they may bring down the network. To prevent this from happening, the time to live component is set to a specific value (with 8 bits so it has a maximum value of 255) such that each router that the packet passes over decrements this value by one. If the packet does not reach its final destination before this number reaches 0, the packet is dropped (because most likely it was lost) and an ICMP message is sent back to the source machine to indicate to it that its packet has been dropped. 3

Protocol (8 bits): This indicates the Transport Layer protocol (TCP, UDP, or even ICMP) that the IP packet is carrying inside of it. Header Checksum (16 bits): It is very important to make sure that the header which contains addresses and other very important information is free of errors. For this, the IP header contains a checksum (that is computed using a specific method) to detect errors that may occur in the header itself (not the data of the packet). Since there are some components of the header that change as the packet travels between routers such as the Time to Live, this header checksum is recomputed at each router after modifying the header and the new checksum is used to replace the old one. Source IP Address (32 bits): Contains the IP address of the source machine. Destination IP Address (32 bits): Contains the IP address of the destination machine. Options (variable length): Allows the source machine to request specific features such as the path of routers over which the packet is to travel over. Padding (variable length): This contains no information but it is used to extend the length of the header to insure that it is a multiple of 4 bytes (or 32 bits). The following summarizes the different components in the IPv4 header. 0 3 4 7 8 11 12 15 16 18 19 23 24 31 0-31 32-63 64-95 IPv4, IPv5, IPv6 5 (if no options) Priority (xxx), Delay (x), Throughput (x), Reliability (x), Cost (x) ID of packet that fragment belong to (to prevent mixing frags from different packets). ID must not be reused until sufficient time has passed 100 (for example) [packet can hop over 100 routers before being discarded] 1 (ICMP), 6 (TCP), 17 (UDP),... 20 65535 Bytes (Max rarely used because nets have their own maximums) Not used, Offset from start of Data in Dont Frag, More Frag multiples of 8 Bytes 10110010101 (to insure integrity of header NOT DATA). Updated when TTL is changed 96-127 128-159 160 -? xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx To request special features (security level, route to be taken by packet, ) 0000..0 to make header length multiple of 32 bits Example 1: 4

See the example on Page 589 of your textbook. Example2: Assume that a router connecting two network (Network 1 and Network 2) has received 3 un fragmented packets from Network 1 and needs to send them over Network 2. Assume the following: The headers of all packets are 20 Bytes long Length of Packet 1 (including header) is 75 Bytes Length of Packet 2 (including header) is 88 Bytes Length of Packet 3 (including header) is 127 Bytes Maximum packet length (including header) that Network 2 can carry is 48 bytes The Don t fragment Flag of Packets 1 and 3 are set to 0, while the Don t Fragment Flag of Packet 2 is set to 1. Determine the following parameters for each fragment (if fragmentation is performed) of the above 3 packets: 1) Identification, 2) More Fragments Flag, 3) Fragment Offset 4) Total Fragment Size Answer 2: First let us strip the headers from the above packets: Length of Packet 1 (without header) is 55 Bytes Length of Packet 2 (without header) is 68 Bytes Length of Packet 3 (without header) is 107 Bytes Maximum packet length (without header) that Network 2 can carry is 28 bytes Packet 1: Since the Don t Fragment flag is set to 0, so fragmentation is allowed. Since the data part of packets that Network 2 can transport is not a multiple of 8, we will have to set the data size of fragments traveling through it to be the multiple of 8 that is just smaller than 28, which is 24 Bytes (which is 3 multiples of 8). Note that we can assume any 16 bit identification number for the segmented packets. 5

So, Fragment Number Identification (Must be less than 65536) More Fragments Flag Fragment Offset 1 15523 1 0 Because (00..0000000 = 0) 2 15523 1 3 Because (00..0011000 = 24) 3 15523 0 6 Because (00..0110000 = 48) Data Length of Fragment Total Fragment Size (Bytes) = Header + Data 7 20+7 = 27 Packet 2: Since the Don t Fragment flag is set to 1, and the size of the packet will not fit into a packet of Network 2, the packet will be dropped and an ICMP message will be sent to the source machine. Packet 3: Since the Don t Fragment flag is set to 0, so fragmentation is allowed. Using a similar case as with Packet 1, we get: Fragment Number Identification (Must be less than 65536) More Fragments Flag Fragment Offset 1 45366 1 0 Because (00..0000000 = 0) 2 45366 1 3 Because (00..0011000 = 24) 3 45366 1 6 Because (00..0110000 = 48) 4 45366 1 9 Because (00..1001000 = 72) 5 45366 0 12 Because (00..1100000 = 96) Data Length of Fragment Total Fragment Size (Bytes) = Header + Data 11 20+11 = 31 6