Network Layer Last Update 2010.02.22 1.1.0 1Copyright 2005-2010 Kenneth M. Chipps Ph.D. www.chipps.com.

Slides:



Advertisements
Similar presentations
1 IP - The Internet Protocol Relates to Lab 2. A module on the Internet Protocol.
Advertisements

Computer Networks20-1 Chapter 20. Network Layer: Internet Protocol 20.1 Internetworking 20.2 IPv IPv6.
CE363 Data Communications & Networking Chapter 7 Network Layer: Internet Protocol.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.
CECS 474 Computer Network Interoperability Notes for Douglas E. Comer, Computer Networks and Internets (5 th Edition) Tracy Bradley Maples, Ph.D. Computer.
Chapter 20 Network Layer: Internet Protocol Stephen Kim 20.1.
Network Layer Packet Forwarding IS250 Spring 2010
1 Computer Networks IP: The Internet Protocol. 2 IP is a connection-less, unreliable network layer protocol IP provides best effort services in the sense.
CSCI 4550/8556 Computer Networks Comer, Chapter 21: IP Encapsulation, Fragmentation, and Reassembly.
CS335 Networking & Network Administration Tuesday, May 11, 2010.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
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.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
Internet Protocol (IP)
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a
Page 19/13/2015 Chapter 8 Some conditions that must be met for host to host communication over an internetwork: a default gateway must be properly configured.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
Chapter 21: IP Encapsulation, Fragmentation & Reassembly
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Suez Canal University – Faculty of Computers & Informatics - Cisco Local Academy Network Fundamentals.
1 IP : Internet Protocol Computer Network System Sirak Kaewjamnong.
Dr. John P. Abraham Professor UTPA
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Network Layer: Internet Protocol.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
The Internet Protocol Dr. Adil Yousif. 2  IP (Internet Protocol) is a Network Layer Protocol. Orientation.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 21.
Communications Services Connection Oriented Service  A connection is established  Data is sent or received over this connection  Connection may be terminated.
CS 4396 Computer Networks Lab
Chapter 20 Network Layer: Internet Protocol
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
1 Kyung Hee University Chapter 8 Internet Protocol (IP)
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets, 5e By Douglas E. Comer Lecture PowerPoints.
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.
Chapter 8 Internet Protocol (IP)
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.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
COMPUTER NETWORKS CS610 Lecture-30 Hammad Khalid Khan.
Network Layer Protocols COMP 3270 Computer Networks Computing Science Thompson Rivers University.
Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
IPv4 IPv4 The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the TCP/IP protocols. Datagram Fragmentation Checksum Options Topics.
Lecture 13 IP V4 & IP V6. Figure Protocols at network layer.
20.1 Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Network Layer & IP Protocol.
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
IP - The Internet Protocol
IP - The Internet Protocol
Net 431: ADVANCED COMPUTER NETWORKS
Internet Protocol (IP)
Chapter 20 Network Layer: Internet Protocol
IP - The Internet Protocol
Dr. John P. Abraham Professor UTPA
IP : Internet Protocol Surasak Sanguanpong
Chapter 20 Network Layer: Internet Protocol
Dr. John P. Abraham Professor UTRGV, EDINBURG, TX
IP - The Internet Protocol
Dr. John P. Abraham Professor UTPA
Net 323 D: Networks Protocols
IP - The Internet Protocol
ITIS 6167/8167: Network and Information Security
IP - The Internet Protocol
NET 323D: Networks Protocols
Presentation transcript:

Network Layer Last Update Copyright Kenneth M. Chipps Ph.D.

The Network Layer Several things happen at the network layer In terms of the TCP/IP routed protocol stack what happens is the IP protocol provides a network level addressing scheme Also at this level, and discussed separately, routing protocols live 2 Copyright Kenneth M. Chipps Ph.D.

The Context for IP LayerProtocol ApplicationFTP/SMTP and many others Port TransportUDP/TCP Protocol Number InternetIP Network InterfaceEthernet handles these functions HardwareEthernet handles these functions Copyright Kenneth M. Chipps Ph.D. 3

What is IP IP – Internet Protocol is the only protocol that lives at this layer This is the first protocol encountered as we enter the bottom of the TCP/IP protocol stack Recall that the bottom two layers are part of the stack, but TCP/IP relies on an underlying system to provide those services Copyright Kenneth M. Chipps Ph.D. 4

What is IP So the first protocol we encounter in the TCP/IP protocol stack is IP It gets the data from one network to another IP was first defined in January 1980 in RFC 760 Copyright Kenneth M. Chipps Ph.D. 5

What is IP As RFC 760 says –The Internet Protocol is designed for use in interconnected systems of packet-switched computer communication networks. –Such a system has been called a "catenet". –The internet protocol provides for transmitting blocks of data called datagrams from sources to destinations, where sources and destinations are hosts identified by fixed length addresses. Copyright Kenneth M. Chipps Ph.D. 6

What is IP –The internet protocol also provides for fragmentation and reassembly of long datagrams, if necessary, for transmission through "small packet" networks. –The internet protocol is specifically limited in scope to provide the functions necessary to deliver a package of bits (an internet datagram) from a source to a destination over an interconnected system of networks. Copyright Kenneth M. Chipps Ph.D. 7

What is IP –There are no mechanisms to promote data reliability, flow control, sequencing, or other services commonly found in host-to-host protocols. Copyright Kenneth M. Chipps Ph.D. 8

Operation IP is a connectionless, unreliable, best effort packet delivery service It is connectionless because each packet is independent of every other packet –A sequence of packets may take entirely different paths to the same end point It is unreliable because delivery is not guaranteed Copyright Kenneth M. Chipps Ph.D. 9

Operation –The packet may be lost, arrive out of order, be delayed –IP will not detect this –So it will not let anyone know if any of this occurs It is best effort because it treats all packets the same –It attempts to deliver each and every packet Copyright Kenneth M. Chipps Ph.D. 10

IP Datagram The thing that IP uses to carry stuff is the IP datagram Like all such devices it has a header and a data area Copyright Kenneth M. Chipps Ph.D HEADERDATA

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 12

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 13

IP Datagram Header VERS or Version –4 bits –The version of IP –Always 4 right now –Shows as binary 0100 –To ensure everyone agrees on the format of the datagram Copyright Kenneth M. Chipps Ph.D. 14

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 15

IP Datagram Header HLEN or Header Length –4 bits –Datagram header length in 32 bit words –Used to indicate whether IP OPTIONS and PADDING fields are being used Copyright Kenneth M. Chipps Ph.D. 16

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 17

IP Datagram Header SERVICE TYPE –8 bits –Specifies how the datagram should be handled –QoS mechanism The current name for this field is Differentiated Services Code Point or DSCP Copyright Kenneth M. Chipps Ph.D. 18

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 19

IP Datagram Header TOTAL LENGTH –16 bits –The length of the datagram in octets including the header and data Copyright Kenneth M. Chipps Ph.D. 20

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 21

IP Datagram Header IDENTIFICATION or Fragment Identifier –16 bits –Holds a unique integer that identifies which datagram a fragment belongs to if the packet has been fragmented, which most are Copyright Kenneth M. Chipps Ph.D. 22

IP Datagram Size Minimum datagram size is 576 bytes –With at least 552 bytes of data Maximum size for an IP datagram is 65,535 bytes –With at most 65,515 bytes of data But Ethernet only handles 1500 bytes of data So how is a 65,535 byte datagram to go into a 1500 byte data area By fragmentation Copyright Kenneth M. Chipps Ph.D. 23

IP Datagram Size It is then reassembled as seen above using the Fragment Offset part of the datagram header Copyright Kenneth M. Chipps Ph.D. 24

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 25

IP Datagram Header FLAG or Fragmentation Flag –3 bits, but part of the FRAGMENT OFFSET field –Indicating that the datagram has been fragmented –Bit 1 is not currently used –Bit 2 is turned on to tell routers to not fragment a packet If the router must, but cannot, the packet is dropped and a message is sent to the receiver Copyright Kenneth M. Chipps Ph.D. 26

IP Datagram Header –Bit 3 when on indicates more fragments are coming When set to 0 it indicates this is the last fragment –All of this information is used to reassemble everything Copyright Kenneth M. Chipps Ph.D. 27

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 28

IP Datagram Header FRAGMENT OFFSET –13 bits –This tells the receiver what piece of a datagram this packet is of a datagram that has been cut up due to the MTU of the underlying method being used to carry the datagram from point-to-point Copyright Kenneth M. Chipps Ph.D. 29

IP Datagram Header –To distinguish fragments, each has its offset field set to the distance, measured in 8 byte units, between the beginning of the original datagram and the beginning of that particular fragment –So the first fragment has an offset of 0, the second fragment has an offset value of the payload size of the first fragment, and so on Copyright Kenneth M. Chipps Ph.D. 30

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 31

IP Datagram Header TTL or Time to Live –8 bits –Supposed to be in seconds, but things run so fast today it is normally hops –Each router decrements the value by 1 Copyright Kenneth M. Chipps Ph.D. 32

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 33

IP Datagram Header PROTOCOL –8 bits –Indicates the higher level protocol used to create the datagram Copyright Kenneth M. Chipps Ph.D. 34

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 35

IP Datagram Header HEADER CHECKSUM –16 bits –Checks the integrity of the header itself –Not the data, the header Copyright Kenneth M. Chipps Ph.D. 36

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 37

IP Datagram Header SOURCE IP ADDRESS –32 bits –Where it came from Copyright Kenneth M. Chipps Ph.D. 38

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 39

IP Datagram Header DESTINATION IP ADDRESS –32 bits –Where its going Copyright Kenneth M. Chipps Ph.D. 40

IP Datagram Header VERS HLEN SERVICE TYPE TOTAL LENGTH IDENTIFICATION FLAG FRAGMENT OFFSET TTL PROTOCOL HEADER CHECKSUM SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS Copyright Kenneth M. Chipps Ph.D. 41

IP Datagram Header IP OPTIONS –24 bits –Not used except in testing Copyright Kenneth M. Chipps Ph.D. 42

IP Datagram Header PADDING –8 bits –To bring the datagram up to a minimum size Copyright Kenneth M. Chipps Ph.D. 43

IP Datagram Header DATA –Size varies –The important stuff Copyright Kenneth M. Chipps Ph.D. 44

Fragmentation As I hope you noticed in the discussion of the fields in the IP header, fragmentation and reassembly is a major factor at the Internet layer Fragmentation introduces quite a bit of processing, as such it is inefficient As we will see later the manner in which fragmentation is handled is significantly changed in IPV6 Copyright Kenneth M. Chipps Ph.D. 45

Fragmentation IP views the things it sends from host to host as datagrams When these datagrams are sent out over the internetwork they are called packets Typically these packets are the fragmented subparts of the datagram Copyright Kenneth M. Chipps Ph.D. 46

Fragmentation This is why the internetwork is called a packet switching network instead of a datagram switching network Why is fragmentation required in IPv4 Let ’ s look at an example The designers of IP could select any datagram size to use They decided to use a datagram 65,535 bytes long Copyright Kenneth M. Chipps Ph.D. 47

Fragmentation The designers of Ethernet decided 1,500 bytes was the best size for a frame on a Ethernet LAN These various limits are called the MTU – Maximum Transfer Unit for a particular device The MTU is the maximum size of a unit that can be handled by a link as defined by the hardware for that link The best MTU is an efficient one Copyright Kenneth M. Chipps Ph.D. 48

Fragmentation Efficiency in this case is where the packet is large enough that the amount of data versus the amount of overhead in terms of the headers required for the unit of information are in balance In this case the larger the better In IP that is 65,535 bytes But efficiency also calls for no fragmentation of the unit of information by the routers along its path Copyright Kenneth M. Chipps Ph.D. 49

Fragmentation Because this fragmentation is overhead, as in extra processing by the routers that fragment it and by the end station that must put it back together This requirement calls for a small enough unit of information that no fragmentation is required At present that is 576 bytes Copyright Kenneth M. Chipps Ph.D. 50

Fragmentation Note the rather large discrepancy here between 576 and 65,535 bytes How does this work Say a full size IP datagram of 65,535 bytes arrives at the Ethernet interface of a router Ethernet has a MTU of 1,500 bytes Copyright Kenneth M. Chipps Ph.D. 51

Fragmentation To deal with this the router must divide the datagram into 44 fragments The end point must then reassemble this mess back into the correct order This is not such a big deal at the LAN end, but is more so if the fragmentation occurs at the router on the way out of the LAN into the WAN Copyright Kenneth M. Chipps Ph.D. 52

Fragmentation A solution to this is to discover the smallest MTU, then set the upper layer protocols to use this value IPV6 will discover this or a guaranteed default MTU can be used that all IPV6 devices will support Copyright Kenneth M. Chipps Ph.D. 53

Fragmentation What methods can IPv4 use There are two –IP Router Segmentation –Path MTU Discovery Copyright Kenneth M. Chipps Ph.D. 54

IP Router Segmentation The simplest approach from the end system point of view is not to worry about the MTU size In this approach the sender simply has to ensure that each packet is less than the MTU of the link on which it is sent The network layer then has to arrange to cut packets up into fragments whenever a router encounters a link with an MTU smaller than the received packet size Copyright Kenneth M. Chipps Ph.D. 55

IP Router Segmentation Recall that all the fragments of a packet carry the same identification in one of the IP header fields The problem with this method is that it places a higher workload on the routers It may also result in fragmentation of fragments as smaller and smaller MTUs are encountered along the way Copyright Kenneth M. Chipps Ph.D. 56

Path MTU Discovery The second method is for the end system to discover how large of a datagram can be sent over the links that will be encountered without requiring fragmentation The way in which the end system finds out this packet size, is to send a large packet, up to the MTU of the link to which it is connected Copyright Kenneth M. Chipps Ph.D. 57

Path MTU Discovery This packet is sent with the DF – Do Not Fragment flag set in the IP header If a router along the path finds that the MTU of the next link exceeds the packet size, the DF flag tells the router not to fragment the packet, but instead to discard the packet Copyright Kenneth M. Chipps Ph.D. 58

Path MTU Discovery An ICMP message is returned by the router to the sender, with a code saying the packet has been discarded and stating the reason was the MTU was exceeded This message also tells the end point what the MTU is The end point may then divide the unit of information itself into chunks that match this MTU Copyright Kenneth M. Chipps Ph.D. 59

Path MTU Discovery For multiple links the end point keeps a table of the MTU of the various IP addresses it is sending to When there are a series of links along the path, each with smaller MTUs, the above process may take place a number of times, before the sender finally determines the minimum MTU Copyright Kenneth M. Chipps Ph.D. 60

Common MTUs Ethernet1,492 Token Ring – 16 MBps17,914 Token Ring – 4 MBps4,464 IP65,535 PPP1,500 Copyright Kenneth M. Chipps Ph.D. 61

Fragmentation Fragmentation is only applied to the data portion of a datagram All fragments carry the full header Fragments are not reassembled until they reach the end point Fragments are stored in memory until all of them arrive, then they are reassembled Copyright Kenneth M. Chipps Ph.D. 62