Chapter 7 Internet Protocol Version 4 (IPv4) Kyung Hee University

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

Chapter 20 Network Layer: Internet Protocol 20.1

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

ET4254 Communications and Networking 1

TSIN02 - Internetworking

Internetwork Protocols

Chapter 4 Network Layer

ECE4110 Internetwork Programming. Introduction and Overview

CHAPTER 18 INTERNET PROTOCOLS ANSWERS TO QUESTIONS

Network Layer: outline

Introduction to Internetworking

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

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.

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

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

Chapter 19 Network Layer: Logical Addressing

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

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

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

User Datagram Protocol

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [NETWORKING] Frequently asked questions from the previous class surveys

EE 610 Part 2: Encapsulation and network utilities

CHAPTER-2 IP CONCEPTS

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

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

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

Chapter 5 OSI Network Layer

IP : Internet Protocol

Networking interview questions

Chapter 11. User Datagram Protocol (UDP)

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

ICS 451: Today's plan

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

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

OSI Network Layer. Chapter 5

SEN366 (SEN374) (Introduction to) Computer Networks

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

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

B.Sc. (Hons.) Computer Science with Network Security B.Eng. (Hons) Telecommunications B.Sc. (Hons) Business Information Systems

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

TCP/IP THE TCP/IP ARCHITECTURE

ICS 351: Networking Protocols

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

Recap. Recap. Internetworking. First mile problem. Internet. End Users. Last mile problem. Direct link networks Packet switching.

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

Introduction to TCP/IP networking

The Network Layer. Antonio Carzaniga. April 22, Faculty of Informatics University of Lugano Antonio Carzaniga

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

Introduction to Networks and the Internet

Last time. Wireless link-layer. Introduction. Characteristics of wireless links wireless LANs networking. Cellular Internet access

EP2120 Internetworking/Internetteknik IK2218 Internets Protokoll och Principer

Course 6. Internetworking Routing 1/33

Data & Computer Communication

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

TSIN02 - Internetworking

Computer Networks (Introduction to TCP/IP Protocols)

TCP/IP Protocol Suite

IP Packet Switching. Goals of Todayʼs Lecture. Simple Network: Nodes and a Link. Connectivity Links and nodes Circuit switching Packet switching

ECE 650 Systems Programming & Engineering. Spring 2018

The Internetworking Problem. Internetworking. A Translation-based Solution

Simulation of TCP Layer

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

ETSF05/ETSF10 Internet Protocols Network Layer Protocols

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

UNIT III. 3.1 Circuit switching vs. packet switching / Packet switched networks. Figure 3.1.1: Switching Techniques

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang

To make a difference between logical address (IP address), which is used at the network layer, and physical address (MAC address),which is used at

Internet Protocols (chapter 18)

APPENDIX F THE TCP/IP PROTOCOL ARCHITECTURE

Introduction Layer 3. IP-Header: and RFC-760 Addressing schemes Subnetting Routing. Layer 3 Solution in Trains

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Internet Control Message Protocol

Network and Security: Introduction

CE3005: Computer Networks Laboratory 3 SNIFFING AND ANALYSING NETWORK PACKETS

Data Communication Prof. A. Pal Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 34 TCP/ IP I

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

The Network Layer. Antonio Carzaniga. November 24, Faculty of Informatics Università della Svizzera italiana

Data Communication & Networks G Session 7 - Main Theme Networks: Part I Circuit Switching, Packet Switching, The Network Layer

Single Network: applications, client and server hosts, switches, access links, trunk links, frames, path. Review of TCP/IP Internetworking

IPv6 Protocols and Networks Hadassah College Spring 2018 Wireless Dr. Martin Land

II. Principles of Computer Communications Network and Transport Layer

Internet protocols, TCP/IP suite

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

Introduction to Networks and the Internet

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

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


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

User Datagram Protocol (UDP):

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

Lecture 2: Basic routing, ARP, and basic IP

TCP /IP Fundamentals Mr. Cantu

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

TSIN02 - Internetworking

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Lecture 11: Networks & Networking

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

Transcription:

Chapter 7 Internet Protocol Version 4 (IPv4) 1

7.1 Introduction The transmission mechanism used by the TCP/IP Unreliable and connectionless datagram protocol Best-effort delivery service IP packets can be corrupted, lost, arrive out of order, or delayed and may create congestion for the network Each datagram is handled independently Each datagram can follow a different route to destination Datagram sent by the same source to the same destination could arrive out of order. 2

Position of IP in TCP/IP protocol suite 3

7.2 Datagrams Datagrams are packets in the network layer Datagram is a variable-length packet consisting of header and data. The header is 20 to 60 bytes, contains information essential to routing and delivery It is customary in TCP/IP to show the header in 4-byte section Field in Header Version(VER) the version of IP protocol (4-bit) Header length(hlen) total length of the datagram header in 4-byte words. 4

IP Datagram 5

IP Datagram TOS(Type of Service) 8-bit x x x 0 0 0 x x x x x 0 Precedence x x x x 1 1 interpretation x x x x 0 1 Differential service interpretation Category Codepoint Assigning Authority 1 XXXXX0 Internet : 24 services 2 XXXX11 Local 3 XXXX01 Temporary or experiment 6

IP Datagram Total Length 16-bit field (limited to 65,535 bytes) Define the total length of the IP datagram in bytes Length of data = total length header length Encapsulation of a small datagram in an Ethernet frame Figure 7.4 Encapsulation of a small datagram in an Ethernet frame 7

IP Datagram Identification used in fragmentation Flags used in fragmentation Fragmentation offset used in fragmentation Time to love limited life time of datagram Protocol the higher level protocol that uses the services of the IP layer Fig. 7.5 Multiplexing 8

IP Datagram Checksum Check errors Source address The IP address of source Destination address The IP address of destination 9

Example 7.1 An IP packet has arrived with the first 8 bit shown: The receiver discards the packet. Why? Solution There is an error in this packet. The 4 left-most bit(0100) show the version, which is correct. The next 4 bit(0010) show the wrong header length(2 4 = 8). The minimum number of byte in the header must be 20. The packet has been corrupted in transmission. 10

Example 7.2 In an IP packet, the value of HLEN is 1000 in binary. How many byte of option 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 option. 11

Example 7.3 In an IP packet, the value of HLEN is 5 16 and the value of the total length field is 0028 16. How many bytes of data are being carried by this packet? Solution The HLEN value is 5, which mean 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). 12

7.3 Fragmentation The format and size of the received frame depend on the protocol used by the physical network When a datagram encapsulated in a frame, the total size of the datagram must be less than MTU(Maximum Transfer Unit) size We must divide the datagram to make it possible to pass through the network; this is called fragmentation 13

MTU(Maximum Transfer Unit) IP datagram Header MTU Maximum length of data that can be encapsulated in a frame Frame Trailer 14

Fragmentation The value of the MTU differs from one physical network protocol to another 15

Fields Related to Fragmentation Identification All fragments have the same identification value Flag 3-bit field Fragmentation offset 13-bit field, the relative position of this fragment with respect to the whole datagram 16

Fragmentation Example 0000 1399 Offset = 0000/8 = 0 Offset = 1400/8 = 175 1400 2799 Offset = 2800/8 = 350 2800 3999 17

Detailed Fragmentation Example 14,567 1420 1 000 14,567 4020 0 000 Bytes 0000 1399 Fragment 1 1420 14,567 1 175 14,567 1 Bytes 1400 2199 Fragment 2.1 820 175 Bytes 0000 3999 Original datagram Bytes 1400 2799 Fragment 2 14,567 1220 0 350 Bytes 2800 3999 Fragment 3 18

Example 7.5 A packet has arrived with an M bit value of 0. Is this first fragment, or a middle fragment? Do we know if the packet was fragment? Solution If the M bit is 0, it means that there are no more fragment; the fragment is the last one. However, we cannot say if the original packet was fragment or not. A nonfragmented packet is considered the last fragment. 19

Example 7.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 is the number of the first byte and the last byte? Solution The first byte number is 100 8 = 800. The total length is 100bytes and the header length is 20bytes (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

7.4 Options Type field (8-bit) : Fixed length Copy : Control the presence of the option in fragmentation Class : Define the general purpose of the option Number : Define the type of option Length field (8-bit) : Fixed length The total length of the option Value field : Variable length Contain the data that specific options require 21

Option Format 8 bits 8 bits Type Length Variable length Value Copy 0 Copy only in first fragment 1 Copy into all fragments Class 00 Datagram control 01 Reserved 10 Debugging and management 11 Reserved Number 00000 End of option 00001 No operation 00011 Loose source route 00100 Timestamp 00111 Record route 01001 Strict source route 22

Categories of Options 23

No Operation Option 1-byte option used as a filter between options 24

End-of-Option Option 1-byte option used for padding at the end of the option field 25

Record-Route Option Used to record the Internet routers that handle the datagram 26

Record-Route Concept 7 15 4 7 15 8 140.10.6.3 7 15 12 140.10.6.3 200.14.7.9 7 15 16 140.10.6.3 200.14.7.9 138.6.22.26 67.34.30.6 138.6.25.40 67.14.10.22 140.10.6.3 140.10.5.4 200.14.7.9 200.14.7.14 138.6.22.26 67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16 Network Network Network Network 27

Strict-Source-Route Option Used by source to predetermine a route for the datagram as it travels through the Internet All of routers defined in the option must be visited by the datagram 28

Strict-Source-Route Concept Source: 67.34.30.6 Destination: 67.14.10.22 140.10.5.4 137 15 4 200.14.7.14 138.6.25.40 Source: 67.34.30.6 Destination:140.10.5.4 137 15 8 67.14.10.22 200.14.7.14 138.6.25.40 Source: 67.34.30.6 Destination:200.14.7.14 137 15 12 67.14.10.22 140.10.5.4 138.6.25.40 Source: 67.34.30.6 Destination:138.6.25.40 137 15 16 67.14.10.22 140.10.5.4 200.14.7.14 67.34.30.6 138.6.25.40 67.14.10.22 140.10.6.3 140.10.5.4 200.14.7.9 200.14.7.14 138.6.22.26 67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16 Network Network Network Network 29

Loose-Source-Route Option Similar to the strict source route, but it is more relaxed. Each router in the list must be visited, but the datagram can visit other routers as well 30

Timestamp Option Used to record the time of datagram processing by a router The time is expressed in miliseconds from Universal Time 31

Use of Flag in Timestamp Flag 0 : each router adds only the timestamp in the provided field Flag 1 : each router must add its outgoing IP address and the timestamp Flag 3 : the IP addresses are given, and each router must check the given IP address with its own incoming IP address 1 0 32

Timestamp Concept 68 28 5 0 1 68 28 13 0 1 140.10.6.3 36000000 68 28 21 0 1 140.10.6.3 36000000 200.14.7.9 36000012 68 28 29 0 1 140.10.6.3 36000000 200.14.7.9 36000012 138.6.22.26 36000020 67.34.30.6 67.14.10.22 140.10.6.3 140.10.5.4 200.14.7.9 200.14.7.14 138.6.22.26 67.0.0.0/24 140.10.0.0/16 200.14.7.0/24 138.6.0.0/16 Network Network Network Network 33

Example 7.11 Which of the six option are used for datagram control and which are used for debugging and management? Solution We look at the second and third (left-most) bits of the type. a. No operation: type is 00000001; datagram control. b. End of option: type is 00000000; datagram control. c. Record route: type is 00000111; datagram control. d. Strict source route: type is 10001001; datagram control. e. Loose source route: type is 10000011; datagram control. f. Timestamp: type is 01000100; debugging and management control. 34

Example 7.12 One of the utilities available in UNIX to check the traveling of the IP packets is ping. In the next chapter, we talk about the ping program in more detail. In this example, we want to show how to use the program to see if a host is available. We ping a server at De Anza College named fhda.edu. The result shows that the IP address of the host is 153.18.8.1. The result also shows the number of bytes used. 35

Example 7.15 The traceroute program can be used to implement loose source routing. The g option allows us to define the routers to be visited, from the source to destination. The following shows how we can send a packet to the fhda.edu server with the requirement that the packet visit the router 153.18.251.4. 36

Example 7.16 The traceroute program can also be used to implement strict source routing. The G option forces the packet to visit the routers in the command line. The following shows how we can send a packet to the fhda.edu server and force the packet to visit only the router 153.18.251.4. 37

7.5 Checksum Checksum The error detection method used by most TCP/IP protocol Protect against the corruption that may occur during the transmission of a packet Redundant information added to the packet Calculated at the sender and the value obtained is sent with the packet The receiver repeats the same calculation on the whole packet including the checksum If the result is satisfactory, the packet is accepted; otherwise, it is rejected 38

Checksum Concept n bits Checksum Packet Receiver Section 1 n bits Section 2 n bits... Checksum n bits... Section k n bits Sum n bits Complement n bits Result If the result is 0, keep; otherwise, discard. 39

Checksum in One s Complement Arithmetic Sum : T Checksum : _ T Sender T _ T Datagram 40

Example 7.17 Figure shows an example of a checksum calculation at the sender site for an IP header without option. 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. Example of checksum calculation at the sender 5 0 1 0 17 10.12.14.5 12.6.7.9 41

Example 7.18 Figure shows the checking of checksum calculation at the receiver site ( or intermediate router ) assuming that no errors occurred in the header. The header is divided into 16-bit sections. All the sections are added and the sum is complement. Since the result is 16 0s, the packet is accepted. 42

7.6 IP over ATM In this section, we want to see how an IP datagram is moving through a switched WAN such as an ATM The IP packet is encapsulated in cells An ATM network has its own definition for the physical address of a device Binding between an IP address and a physical address is attained through a protocol called ATMARP 43

An ATM WAN in the Internet 44

AAL Layer The AAL layer used by the IP protocol is AAL5 The only AAL used by the Internet is AAL5 It is sometimes called the simple and efficient adaptation layer (SEAL). AAL5 accepts an IP packet of no more than 65,536 bytes and adds 8-byte trailer AAL5 passes the message in 48-byte segments to the ATM layer 45

Cell Routing The cells start from the entering-point router and end at the exiting-point router IP Packet ATM cell I II III Entering-point router ATM Network Exiting-point router IP Packet 46

Address Binding in IP over ATM An ATM network needs virtual circuit identifiers to route the cell IP datagram contains only source and destination IP address Virtual circuit identifiers must be determined from the destination IP address. 47

7.7 Security Since the IPv4 protocol was started when the Internet user trusted each other, no security was provided for the IPv4 protocol Today, however, the situation is different The Internet is not secure any more In this section, we give a brief idea about the security issues in IP protocol and the solution 48

Security Issues Packet sniffing Passive attack The attacker does not change the contents of the packet Encryption of the packet attacker cannot see the contents of packet Packet modification Active attack The attacker intercepts the packet, change the contents of the packet Data integrity receiver can make sure that packet has not been changed during the transmission IP spoofing An attacker can masquerade as somebody else and create an IP packet that carries the source address of another computer Origin authentication mechanism can prevent this type of attack 49

IPSec (IP Security) Create a connection-oriented service between two entities in which they can exchange IP packet without worrying about the three attacks discussed before Defining Algorithms and Key The two entities that want to create a secure channel between themselves can agree on some available algorithms and keys to be used for security purpose Packet Encryption Make the packet sniffing attack useless Data Integrity Guarantee that the packet is not modified during the transmission Origin Authentication Prevent IP spoofing attack 50

7.8 IP Package IP package involves eight component Header-adding module Processing module Forwarding module Fragmentation module Reassembly module Routing module MTU table Reassembly table 51

IP Component 52

IP Header-Adding Module 53

Processing Module 54

Queue IP Package Input queue store the datagram coming from the data link layer or the upper-layer protocols Output queue store the datagram going to the data link layer or the upper-layer protocols Routing table Used by the forwarding module to determine the next-hop address of the packet Forwarding module Receive an IP packet from the processing module Find the IP address of the next station along with the interface number to which the packet should be sent MTU table Used by the fragmentation module to find the maximum transfer unit of a particular interface 55

Fragmentation Module 56

Fragmentation Module 57

Reassembly Table Used by reassembly module State field : FREE or IN-USE IP address field : define the source IP address of the datagram Datagram ID : number that uniquely defines a datagram Timeout : predetermined amount of time in which all fragments must arrive Fragment field : a pointer to a linked list of fragment 58

Reassembly Module 59

Summary IP is an unreliable connectionless protocol responsible for source-to-destination delivery. Packets in the IP layer are called datagrams The MTU is the maximum number of bytes that a data link protocol can encapsulate. MTUs vary from protocol to protocol. Fragmentation is the division of a datagram into smaller units to accommodate the MTU of a data link protocol The IP datagram header consists of a fixed, 20-byte section and a variable options section with a maximum 40 bytes. The options section of the IP header is used for network testing and debugging. The six IP options each have a specific function 60

Summary The error detection method used by IP is the checksum. The checksum, however, convers only the header, but not the data. The checksum uses one s complement arithmetic to add equal-size sections of the IP header. The complement result is stored in the checksum field. The receiver also used one s complement arithmetic to check the header. IP over ATM uses AAL5 layer in an ATM network. An ATM network creates a route between an entering-point router and exiting-point router. The next-hop address of an IP packet can be mapped to a physical address of an exiting-point router using ATMARP An IP package can consist of the following : a header-adding module, a processing module, a forwarding module, a fragmentation module, a reassembly module, a routing table, an MTU table, and a reassembly table. 61