Chapter 8 Internet Protocol (IP)

Slides:



Advertisements
Similar presentations
CE363 Data Communications & Networking Chapter 7 Network Layer: Internet Protocol.
Advertisements

U N I T - 3.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Internet Protocol/ Network Layer. 2 Position of IP in TCP/IP protocol suite.
IPv4 - The Internet Protocol Version 4
NETWORK LAYER (1) T.Najah AlSubaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
1 IP - The Internet Protocol Relates to Lab 2. A module on the Internet Protocol.
Chapter 20 Network Layer: Internet Protocol Stephen Kim 20.1.
Internet Protocol (IP)
1 TDC TDC 365 Network Interconnections Technologies Lecture #4 Notes Spring, 2009.
TCP/IP Protocol Suite 1 Chapter 8 Upon completion you will be able to: Internet Protocol Understand the format and fields of a datagram Understand the.
Oct 19, 2004CS573: Network Protocols and Standards1 IP: Datagram and Addressing Network Protocols and Standards Autumn
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Internet Protocol Version4.
1 Kyung Hee University Part 4 : Network Layer. 2 Kyung Hee University Role and Position of Network Layer o Network layer in the Internet model is responsible.
Module 10. Internet Protocol (IP) is the routed protocol of the Internet. IP addressing enables packets to be routed from source to destination using.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
1 Kyung Hee University Chapter 7 Internet Protocol Version 4 (IPv4)
資 管 Lee Lesson 5 IP Packets: Delivery and Routing IP Layer operation.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 5 Internet Protocol (IP) Basics.
1 IP : Internet Protocol Computer Network System Sirak Kaewjamnong.
Dr. John P. Abraham Professor UTPA
Internet Protocol --- Connectionless Datagram Delivery Linda Wu (CMPT )
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ECE 4110 – Internetwork Programming IP Protocol. 2 * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall Position of IP in TCP/IP Protocol Suite.
Network Layer: Internet Protocol.
1 Chapter 8 Internet Protocol (IP) Chapter 8 Internet Protocol (IP) Mi-Jung Choi Dept. of Computer Science and Engineering
TCP/IP Protocol Suite 1 Chapter 8 Upon completion you will be able to: Internet Protocol Understand the format and fields of a datagram Understand the.
Communications Services Connection Oriented Service  A connection is established  Data is sent or received over this connection  Connection may be terminated.
Chapter 20 Network Layer: Internet Protocol
Network Layer4-1 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection”
1 Kyung Hee University Chapter 8 Internet Protocol (IP)
TCP/IP Protocol Suite 1 Chapter 8 Upon completion you will be able to: Internet Protocol Understand the format and fields of a datagram Understand the.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
1 Computer Communication & Networks Lecture 19 Network Layer: IP and Address Mapping Waleed Ejaz.
Internet Protocol Version 4 VersionHeader Length Type of Service Total Length IdentificationFragment Offset Time to LiveProtocolHeader Checksum Source.
Net7: IP 協定 Internet Protocol 授課教師:雲林科技大學 張慶龍 老師.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
Network Layer Protocols COMP 3270 Computer Networks Computing Science Thompson Rivers University.
IP Fragmentation. Network layer transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side,
Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Internet Protocol Version4.
IPv4 IPv4 The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the TCP/IP protocols. Datagram Fragmentation Checksum Options Topics.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 User Datagram Protocol
Chapter 19 Network Layer Protocols
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
IP - The Internet Protocol
Chapter 9 ICMP.
7 Network Layer Part IV Computer Networks Tutun Juhana
Chapter 8: Internet Protocol (IP)
Chapter 7: The Infamous IP
IP - The Internet Protocol
Internet Protocol Version4
Chapter 20 Network Layer: Internet Protocol
Internet Protocol Version4
Chapter 14 User Datagram Protocol (UDP)
Chapter 7: The Infamous IP
Dr. John P. Abraham Professor UTPA
Dr. John P. Abraham Professor UTRGV, EDINBURG, TX
IP - The Internet Protocol
Dr. John P. Abraham Professor UTPA
Net 323 D: Networks Protocols
Chapter 7 Internet Protocol Version 4 (IPv4)
Internet Protocol (IP)
ITIS 6167/8167: Network and Information Security
NET 323D: Networks Protocols
32 bit destination IP address
Presentation transcript:

Chapter 8 Internet Protocol (IP)

Position of IP in TCP/IP protocol suite

IP is the transmission mechanism used by the TCP/IP protocol Introduction IP is the transmission mechanism used by the TCP/IP protocol It is unreliable and connectionless datagram protocol Providing Best-effort delivery service (best-effort : no error checking and tracking)

8.1 Datagram Packets in the IP layer : called datagrams IP datagram format Variable-length packet consisting of header and data Header 20 ~ 60 bytes Containing information that is essential for routing and delivery IP header Version (VER) : Version 4 or 6 (IPng) Header length (HLEN) : represented by in 4 byte words Ex) if HLEN = 5, the real header length is 20 bytes

Datagram (cont’d)

Datagram (cont’d) Service Type Defining how the datagram should be handled by the routers Precedence : 3 bits Defining the priority of the datagram in issues such as congestion Ex) a datagram for network management vs. optional information to a group of people At present, not used in version 4 service type : 4 bits (TOS bits) With only one bit set at a time Remaining bit : not used

Datagram (cont’d) Service type or Differentiated Services

Datagram (cont’d) Types of service TOS bits Description 0000 Normal 0001 Minimize cost 0010 Maximize reliability 0100 Maximize throughput 1000 Minimize delay

Datagram (cont’d) Default types for some applications in use of TOS Protocol TOS bits Description ICMP 0000 Normal BOOTP NNTP 0001 Minimize cost IGP 0010 Maximize reliability SNMP TELNET 1000 Minimize delay FTP (data) 0100 Maximize throughput FTP (control) TFTP SMTP (command) SMTP (data) DNS (UDP query) DNS (TCP query) DNS (zone)

Datagram (cont’d) Differentiated Services Category Codepoint The first 6 bits : codepoint subfield Values for codepoints Category Codepoint Assigning Authority 1 XXXXX0 Internet 2 XXXX11 Local 3 XXXX01 Temporary or experiment

Datagram (cont’d) Total Length : head + data Defining the total length of the datagram including the header Length of data = total length – header length Limited to 65,535 (216 – 1) bytes Encapsulation of a small datagram in an Ethernet Frame Ethernet Frame size : 46 ~ 1500 bytes

Datagram (cont’d) Flags : used in fragmentation Fragmentation offset : used in fragmentation Time to live Used to control the maximum number of hops (routers) visited by the datagram If the value is Zero, the routers discarded If the source wants to confine the packet to the local network, it can store 1 in this field

Datagram (cont’d) Protocol Defining the higher level protocol that uses the services of the IP layer TCP, UDP, ICMP, and IGMP Multiplexing data from different higher level protocols Value Protocol 1 ICMP 2 IGMP 6 TCP 8 EGP 17 UDP 89 OSPF

Datagram (cont’d) Example 1 An arriving IP packet :  01000010 The receiver discards the packet, Why ? - 2 x 4 bytes = 8bytes : Minimum number of bytes in the header must be 20

Datagram (cont’d) Example 2 The value of HLEN is 1000 in binary How many bytes of options are being carried by this packet ?  8 x 4 bytes = 32 bytes : 20 bytes + 12 bytes (option)

Datagram (cont’d) Example 3 - In an IP packet, the value of HLEN is 5 16 and the value of the total length field is 002816. How many bytes of data are being carried by this packet? Answer The HLEN value is 5, which means 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).

Datagram (cont’d) Example 4 An IP packet has arrived with the first few hexadecimal digits as shown below:  45000028000100000102................... How many hops can this packet travel before being dropped? The data belong to what upper layer protocol?

Datagram (cont’d) Answer To find the time-to-live field, we should skip 8 bytes (16 hexadecimal digits). The time-to-live field is the ninth byte, which is 01. This means the packet can travel only one hop. The protocol field is the next byte (02), which means that the upper layer protocol is IGMP.

Datagram (cont’d) Checksum : header checksum- 16 bits Source IP address : 32 bit-field Destination IP address : 32 bit-field

8.2 Fragmentation The format and size of the received frame depend on the protocol used by the physical network Ex) A router connecting Ethernet to token ring

Fragmentation (cont’d) MTU (Maximum Transfer Unit) When a datagram is encapsulated in a frame, the total size of the datagram must be less than this maximum size

Fragmentation (cont’d) MTUs for different networks Protocol MTU Hyperchannel 65,535 Token ring (16Mbps) 17,914 Token ring (4Mbps) 4,464 FDDI 4,352 Ethernet 1,500 X.25 576 PPP 296 Hyperchannel : Network Systems Corporation, 1988 (RFC 1044)

Fragmentation (cont’d) The maximum length of the IP datagram equals to the largest MTU defined so far (65,535 bytes) Therefore, for the other physical networks we must divide the datagram : fragmentation datagram that can be fragmented by the source host or any router in the path, but the reassembly of datagram is done by the destination When a datagram is fragmented, required parts of the header must be copied by all fragments. Changing the values of the three fields : flags, fragmentation offset, and total length The rest of fields must be copied Checksum must be recalculated

Fragmentation (cont’d) Fields related to fragmentation Identification : 16 bit-field Datagram id that is originated by the source host Therefore, Source IP address + datagram id (identification) All fragments having same identification number Identification No. to be used for the destination in reassembling the datagram Flags : 3 bit-field D : Do not fragment (1) If it can not pass the datagram through any available physical network, it discards the datagram and send ICMP error message to the source host M : More fragment (0) 0 : last fragment or only fragment

Fragmentation (cont’d) Fragmentation offset : 13-bit field Showing relative position of this fragment with respect to the whole datagram Measured in units of 8 bytes : forcing hosts or routers that fragment datagrams to choose the size of each fragment so that the first byte number is divisible by eight

Fragmentation (cont’d)

8.3 Options Variable part of the IP datagram : the maximum of 40 bytes Format : Code, Length, and Data

Options (cont’d) Code field 8 bits length and containing 3 subfields : copy, class, and number Copy Controlling the presence of the option in fragmentation 0 : meaning that option must be copied only to the first fragment 1 : meaning the option must be copied to all fragments Class Defining the general purpose of the option 00 : datagram control, 01 : reserved, 10 : Debugging and management, 11: reserved

Options (cont’d) Length Number Defining the type of the option : only 6 options that are currently being used Length defining the total length of the option including the code field and length field itself Data containing the data that specific options require

Options (cont’d) Option Types

Options (cont’d) No Operation one byte option used as a filler between options

Options (cont’d) End of Option one-byte option used for padding at the end of the option field used as the last option

Options (cont’d) Record Route used to record the internet routers that handle the datagram list up to 9 router IP addresses since the max. size of the header is 60 bytes (Base header : 20 bytes) pointer field An offset integer field containing the byte number of the first empty entry (available entry) When leaving the source, the pointer field has a value of four, pointing to the first empty field

Options (cont’d) Record route option

Options (cont’d)

Options (cont’d) Strict Source Route used by the source to predetermine a route for the datagram as it travels through the Internet can choose a route with specific type of service : minimum delay or maximum throughput

Options (cont’d) Strict source route concept

Options (cont’d) Loose Source Route 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

Options (cont’d) Time Stamp used to record the time of datagram processing by a router expressed in millisecond from the midnight, Universal Time

Options (cont’d) overflow field : recording the number of routers that could not add their timestamp because no more fields were available Use of flag in timestamp

Options (cont’d) Timestamp concept (when flag =1)

Error detection method used by most TCP/IP protocols 8.4 Checksum Error detection method used by most TCP/IP protocols Checksum calculation at the sender The packet is divided into k sections, each of n bits ( n is usually 16) All sections are added together using one’s complement arithmetic The final result is complemented to make the checksum

Checksum calculation at the receiver Checksum (cont’d) Checksum calculation at the receiver The packet is divided into k sections, each of n bits. All sections are added together using one’s complement arithmetic The result is complemented If the final result is 0, the packet is accepted; otherwise it is rejected

Checksum (cont’d) Checksum concept

Checksum (cont’d) Checksum in one’s complement arithmetic

Checksum in the IP Packet Checksum (cont’d) Checksum in the IP Packet covering only the header, not the data all higher level protocols that encapsulate data in the IP datagram have a checksum field that covers the whole packet the header changes with each visited router, but data does not. So the checksum includes only the part which has changed if each router must recalculates the checksum, it is needed to have the more processing time for each router

Checksum (cont’d) Example

IP package : 8 components Header-adding module Processing module Routing module fragmentation module reassembly module routing table MTU table reassembly table

IP Package (cont’d) IP components

The operation of IP package IP Package(cont’d) The operation of IP package receiving an IP packet, either from the data link layer or a higher level protocol if the packet comes from a upper layer protocol, it should be delivered to the data link layer if the packet comes from the data link layer, forwarding to data link or a upper layer ( the destination is same as the station address)

IP Package (cont’d) Header-adding Module Receive : data, destination address Encapsulate the data in an IP datagram Calculate the checksum and insert it in the checksum field Send the data to the corresponding input queue Return

IP Package (cont’d) Processing Module Remove one datagram from one of the input queues if (destination address is 127.X.Y.Z or matches one of the local addresses) Send datagram to the reassembly module. Return if (machine is a router) Decrement TTL if (TTL less than or equal to zero) Discard the datagram Send an ICMP error message Send the datagram to the routing module

IP Package (cont’d) Queues Routing table Routing module Input queues and output queues Routing table used by the routing module to determine the next-hop address of the packet Routing module receiving an IP packet from the processing module sending the packet with the information to the fragmentation module

IP Package (cont’d) MTU Table to find the maximum transfer unit of a particular interface.

IP Package (cont’d) Fragmentation Module Receive : an IP packet from routing module Extract the size of the datagram if (size > MTU of the corresponding network) If (D (do not fragment) bit is set Discard the datagram Send an ICMP error message Return Else Calculate the maximum size Divide the datagram into fragments Add header to each fragment Add required options to each fragment Send the datagram

IP Package (cont’d) Reassembly Table State field : FREE or IN-USE Source IP address of datagram Datagram ID Time-out : a predetermined amount of time in which all fragments must arrive Fragment field : a pointer to a linked list of fragments

IP Package (cont’d)

IP Package (cont’d) Reassembly Module Receive : an IP packet from the processing module If (offset value is zero and the M bit is 0) Send the datagram to the appropriate queue Return Search the reassembly table for the corresponding entry If (not found) Create a new entry

IP Package (cont’d) 5. Return 4. Insert the fragment at the appropriate place in the linked list if (all fragments have arrived) Reassemble the fragments Deliver the datagram to the corresponding upper layer protocol Return Else Check the time-out if (time-out expired) Discard all fragment Send an ICMP error message 5. Return

Summary (1) IP is an unreliable connectionless protocol responsible for source-to-destination delivery. Packets in the IP layer are called datagrams A datagram consists of a header (20 to 60 bytes) and data. The IP header contains the following information: version number, header length, differentiated services, datagram length, identification number, fragmentation flags, fragmentation offset, time to live, protocol, checksum, source address, destination address, and options. The maximum length of a datagram is 65,535 bytes. The MTU is the maximum number of bytes that a data link protocol can encapsulate. MTUs vary from protocol to protocol.

Summary (2) Fragmentation is the division of a datagram into smaller units to accommodate the MTU of a data link protocol. The fields in the IP header that relate to fragmentation are the identification number, the fragmentation flags, and the fragmentation offset. The IP datagram header consists of a fixed, 20-byte section and a variable options section with a maximum of 40 bytes. The options section of the IP header is used for network testing and debugging. The options header contains the following information: a code field that identifies the option, option length, and the specific data.

Summary (3) The six IP options each have a specific function. They are as follows: filler between options for alignment purposes, padding, recording the route the datagram takes, selection of a mandatory route by the sender, selection of certain routers that must be visited, and recording of processing times at routers. The ping and traceroute utilities in UNIX can be used to implement some of the IP options. The error detection method used by IP is the checksum. The checksum uses one's complement arithmetic to add equal-size sections of the IP header. The complemented result is stored in the checksum field. The receiver also uses one's complement arithmetic to check the header. 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.