IP Packet Fragmentation Tutorial

Similar documents
Internet Architecture and Philosophy

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

Network Layer IPv4. Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS. School of Computing, UNF

Lecture 15. IP address space managed by Internet Assigned Numbers Authority (IANA)

Chapter 9. IP Secure

IP - The Internet Protocol

Chapter 3. TCP/IP Networks. 3.1 Internet Protocol version 4 (IPv4)

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

RARP: Reverse Address Resolution Protocol

Protocol Data Units and Encapsulation

Communications and Computer Networks

Overview of TCP/IP. TCP/IP and Internet

Introduction to IP v6

SFWR 4C03: Computer Networks & Computer Security Jan 3-7, Lecturer: Kartik Krishnan Lecture 1-3

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Limitations on Monitored Lines

Network Layer: Network Layer and IP Protocol

Internet Packets. Forwarding Datagrams

UPPER LAYER SWITCHING

Exam 1 Review Questions

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

ELEC3030 (EL336) Computer Networks. How Networks Differ. Differences that can occur at network layer, which makes internetworking difficult:

Ethernet. Ethernet. Network Devices

A PPENDIX L TCP/IP and OSI

CS 43: Computer Networks IP. Kevin Webb Swarthmore College November 5, 2013

04 Internet Protocol (IP)

CPS221 Lecture: Layered Network Architecture

8.2 The Internet Protocol

PART OF THE PICTURE: The TCP/IP Communications Architecture

Application Note. Windows 2000/XP TCP Tuning for High Bandwidth Networks. mguard smart mguard PCI mguard blade

Future Internet Technologies

NETWORK LAYER/INTERNET PROTOCOLS

Data Communication Networks and Converged Networks

Network Security TCP/IP Refresher

Gary Hecht Computer Networking (IP Addressing, Subnet Masks, and Packets)

Adjusting IP MTU, TCP MSS, and PMTUD on Windows and Sun Systems

Homework Assignment #1 Solutions

TCP/IP Network Essentials. Linux System Administration and IP Services

ACHILLES CERTIFICATION. SIS Module SLS 1508

PART IV. Network Layer

Protocols. Packets. What's in an IP packet

Internetworking. Problem: There is more than one network (heterogeneity & scale)

Lecture Computer Networks

Networking Test 4 Study Guide

How do I get to

CS 457 Lecture 19 Global Internet - BGP. Fall 2011

Moven Studio realtime. streaming

CS335 Sample Questions for Exam #2

Answers to Sample Questions on Network Layer

IPV6 FRAGMENTATION. The Case For Deprecation. Ron Bonica NANOG58

Data Communication Networks

(Refer Slide Time: 01:38 01:37)

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

RTP / RTCP. Announcements. Today s Lecture. RTP Info RTP (RFC 3550) I. Final Exam study guide online. Signup for project demos

Network layer" 1DT066! Distributed Information Systems!! Chapter 4" Network Layer!! goals: "

IPv6 Fundamentals Ch t ap 1 er I : ntroducti ti t on I o P IPv6 Copyright Cisco Academy Yannis Xydas

Chapter 4 Network Layer

NAT & IP Masquerade. Internet NETWORK ADDRESS TRANSLATION INTRODUCTION. NAT & IP Masquerade Page 1 of 5. Internal PC

Network Models and Protocols

2. IP Networks, IP Hosts and IP Ports

Address Resolution Protocol (ARP), Reverse ARP, Internet Protocol (IP)

Computer Networks and the Internet

Network layer: Overview. Network layer functions IP Routing and forwarding

Final for ECE374 05/06/13 Solution!!

Transport Layer. Chapter 3.4. Think about

The OSI and TCP/IP Models. Lesson 2

Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address

Internet Protocol Version 6 (IPv6)

his document discusses implementation of dynamic mobile network routing (DMNR) in the EN-4000.

Module 2: Assigning IP Addresses in a Multiple Subnet Network

Lecture 8. IP Fundamentals

Expert Reference Series of White Papers. Basics of IP Address Subnetting

- IPv4 Addressing and Subnetting -

Internet Working 5 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2004

Objectives of Lecture. Network Architecture. Protocols. Contents

13 Virtual Private Networks 13.1 Point-to-Point Protocol (PPP) 13.2 Layer 2/3/4 VPNs 13.3 Multi-Protocol Label Switching 13.4 IPsec Transport Mode

101 Application Delivery Fundamentals

TCP/IP Programming. Joel Snyder, Opus1 Geoff Bryant, Process Software

Slide 1 Introduction cnds@napier 1 Lecture 6 (Network Layer)

Transport Layer Protocols

IP Addressing Introductory material.

Internetworking and IP Address

TCP/IP Cheat Sheet. A Free Study Guide by Boson Software, LLC

Access Control: Firewalls (1)

Date 07/05/ :20:22. CENTREL Solutions. Author. Version Product XIA Configuration Server [ ]

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

Wide Area Networks. Learning Objectives. LAN and WAN. School of Business Eastern Illinois University. (Week 11, Thursday 3/22/2007)

IP Addressing. IP Addresses. Introductory material.

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Introduction To Computer Networking

Internet Protocols Fall Lectures 7-8 Andreas Terzis

6LoWPAN Technical Overview

LESSON Networking Fundamentals. Understand TCP/IP

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

Midterm Exam CMPSCI 453: Computer Networks Fall 2011 Prof. Jim Kurose

Transport and Network Layer

Assignment #3 Routing and Network Analysis. CIS3210 Computer Networks. University of Guelph

Chapter 3: Review of Important Networking Concepts. Magda El Zarki Dept. of CS UC Irvine

Transcription:

1 IP Packet Fragmentation Tutorial Abstract This tutorial covers IP fragmentation, data payloads, IP packet and header lengths, maximum transmission unit (MTU), and fragmentation offset (FO). Keywords: packet fragmentation, payloads, headers, maximum transmission unit, mtu, fragmentation offset, fo, tcp/ip Published: 11-16-2009; Updated: 10-07-2016 E. Garcia, PhD; admin@minerazzi.com Note: This article is part of a legacy series that the author published circa 2009 at http://www.miislita.com, now a search engine site. It is now republished in pdf format here at http://www.minerazzi.com, with its content edited and updated. Introduction The data payload (DP) of an IP packet (IP datagram) is defined as the packet length (PL) minus the length of its IP header (IPHL), (1) Per RFCs 791 and 829, the largest packet allowed by TCP/IP standards is 65,535 (i.e., 2 16 1) octets, the minimum IPHL is 20 octets, and the maximum IPHL is 60 octets. In computer sciences, an octet is a group of 8 bits called a byte. Octet is also the French word for byte. Thus, the largest data payload of an IP packet that conforms to TCP/IP standards is 65,515 bytes. Since such long datagrams are impractical for most hosts and networks, some limiting values have been adopted. One of these limiting values is the so-called Maximum Transmission Unit size or MTU. MTU Values MTU is defined as the largest IP packet that can be transmitted without fragmentation. However, maximum is a relative term, subject to technology requirements. For instance according to RFC 791 (emphasis added), All hosts must be prepared to accept datagrams of up to 576 octets (whether they arrive whole or in fragments). It is recommended that hosts only send datagrams

2 larger than 576 octets if they have assurance that the destination is prepared to accept the larger datagrams.. This is a long established TCP/IP rule. Therefore, hosts should not send packets with MTU values greater than 576 bytes, unless they know that the destination accepts larger packets. As network and media types evolve, vendors have adopted MTUs greater than the 576 mark. Per RFC 1191, the default MTU for Ethernet v2 networks is 1,500 bytes. Table 1 lists MTUs for different Ethernet versions, networks, and media. Table 1. MTU values for several Ethernet versions, networks, and media types (RFCs 879, 1191, and 2675). Ethernet version 802.3 (v1) v2 802.11 802.5 Jumbo Frames MTU, in bytes 1,492 1,500 2,272 4,464 1,500 9,000 Media types Internet IPv4 ARPANET, MILNET Internet IPv6 Proteon PRONET Token Ring FDDI MTU, in bytes at least 68 1,007 at least 1,280 2,046 4,096 4,500 As at the time of writing all IP over Ethernet implementations are Ethernet v2, the 1,500 mark is used in this tutorial; unless stated otherwise. Since the default IP header is 20 bytes, a working data payload of 1,500 20 = 1,480 bytes is assumed. Techniques for determining experimentally MTU values are discussed in the MTU and MSS Tutorial (Garcia, 2009). IP Fragmentation IP packets larger than the permitted MTU must be divided into n smaller packets called fragments, each with their own header length, packet length (pl), and data payload (dp). (2) (3) where (3) can be written as (4) (5) From (5), two important concepts can be derived: fragment offsets and number of fragments.

3 Fragment Offsets Given a sequence of fragments from the same packet, the fragment offset (FO) of fragment i is defined as the sum of data payloads of previous fragments, expressed as a multiple of 8. Since i = 1, 2, 3 n, (5) leads to (6) (7) Table 2 depicts the expected sequence of FO values for MTU = 1,500 bytes and IPHL = 20 bytes. Table 2. Sequence of FO values for MTU = 1,500 bytes and IPHL = 20 bytes. i 1 2 3 4 n FO i 0 185 370 555 (n - 1)*185 Once a packet is fragmented, each fragment is tagged with the destination address and a sequence number. As the fragments traverse the network between the source and destination hosts the best current path available to each fragment is used. In this way, if a network link goes down, not all the fragments have to be re-sent. At the destination host, the fragments might arrive at different times, out of sequence, or even through the same path or different paths. When all the fragments reach the destination, these are reordered according to the sequence numbers and FO s and the original packet reconstructed. Since the fragments must arrive at the destination host using the best current path available and lost fragments must be re-sent prior to reassembling, intermediate routers should not attempt to reassemble the fragments back to the original packet. Number of Fragments When a packet is fragmented, normally the length and data payload of the last fragment is not known in advance. All it can be said is that pl n MTU and dp n MTU IPHL. (5) then leads to two possible scenarios:

4 Scenario 1: if dp n = MTU IPHL (8) (9) (10) Scenario 2: if dp n < MTU IPHL (11) (12) (13) (14) Thus in order for dp n be equal to MTU IPHL, the ratio (PL IPHL)/(MTU IPHL) must be a whole number (integer); otherwise the ratio must be incremented by 1 and n be calculated by rounding off the result to the nearest integer. Moreover, dropping the IPHL term from (13) and (14) the following lower and upper bounds for n are obtained: PL/MTU n PL/MTU + 1 (15) Last but not least, an IP packet encapsulates a TCP packet such that DP = TCPHL + MSS (16)

5 where TCPHL is the length of the TCP header and MSS is the data payload of the TCP packet, also known as the Maximum Segment Size. Figure 1 and the last section of this tutorial illustrate all these concepts. Figure 1. Fragmentation example where MTU = PL = pl 1 = pl 2 > pl 3 and DP = dp 1 + dp 2 + dp 3 = PL IPHL. Sample Problem A 3,000-byte IP packet with a default IPHL of 20 bytes must be sent over an Ethernet v2 network. 1. What is the data payload of the packet? 2. In how many fragments this packet must be decomposed? 3. What are the FO s of the fragments? 4. What are the data payloads of the fragments? 5. How long the fragments are? 6. What are the expected lower and upper bounds

6 Solution For Ethernet v2, MTU = 1,500 bytes. 1. From (1), the data payload of the packet is DP = 3,000 20 = 2,980 bytes 2. From (10), n = (3,000 20)/(1,500 20) = 2.0135 Since this result is not a whole number, it is incremented by 1 and rounded off to the nearest integer; i.e. n = 2.0135 + 1 = 3.0135 = 3 3. From (7), the fragment offsets are: FO 1 = (1 1)*(1,500 20)/8 = 0 FO 2 = (2 1)*(1,500 20)/8 = 185 FO 3 = (3 1)*(1,500 20)/8 = 370 4. From (2 5), the data payloads of the fragments are: dp 1 = 1,500 20 = 1480 bytes dp 2 = 1,500 20 = 1480 bytes dp 3 = DP (dp 1 + dp 2 ) = DP 8*FO 3 = 2980 2,960 = 20 bytes 5. The lengths of the fragments are: pl 1 = dp 1 + IPHL = 1,500 bytes

7 pl 2 = dp 2 + IPHL = 1,500 bytes pl 3 = dp 3 + IPHL = 40 bytes 6. From (15), the expected lower and upper bounds of n are: PL/MTU = 3,000/1,500 = 2 PL/MTU + 1 = 3 2 n 3 Therefore regardless of whether IPHL is 20 or 60 bytes, the packets must be broken up into no more than 3 fragments. Conclusion In this tutorial we discussed IP fragmentation, data payloads, IP packet and header lengths, maximum transmission unit (MTU), and fragmentation offset (FO). Techniques for determining experimentally MTU values were not discussed. These are covered in the MTU and MSS Tutorial (Garcia, 2009). Exercises 1. A 2,400-byte packet with an IP header of 20 bytes must be broken into fragments no larger than 620 bytes. a. In how many fragments should the packet be decomposed? b. What is the data payload of the packet? c. What are the data payloads, lengths, and FO s of the fragments? 2. A packet is decomposed into 3 fragments, each with a header IP length of 20 bytes. The length of last fragment is 300 bytes and its FO is 150. a. What is the network MTU? b. What is the data payload of the last fragment?

8 c. What is the combined data payload of the fragments excluding last fragment? d. What are the FO s of the fragments? e. What is the length and data payload of the original packet? 3. Suppose that in Exercise 2, a second packet must be sent as a group of three fragments. Calculate its minimum and maximum allowed size. References Garcia, E. (2009). MTU and MSS Tutorial Retrieved from http://www.minerazzi.com/tutorials/mtu-mss-tutorial.pdf Internet Engineering Task Force (2009). Retrieved from http://www.ietf.org