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

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

Vorlesung Kommunikationsnetze

Module 7 Internet And Internet Protocol Suite

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

TSIN02 - Internetworking

Introduction to Internetworking

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

ICMP (Internet Control Message Protocol)

Network Layer: Control/data plane, addressing, routers

II. Principles of Computer Communications Network and Transport Layer

Network Layer: Internet Protocol

Internet Protocols (chapter 18)

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

Network Layer: DHCP, ICMP, NAT, IPv6

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Last time. Network layer. Introduction. Virtual circuit vs. datagram details. IP: the Internet Protocol. forwarding vs. routing

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

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

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

Router Architecture Overview

Department of Computer and IT Engineering University of Kurdistan. Network Layer. By: Dr. Alireza Abdollahpouri

TSIN02 - Internetworking

CS 457 Lecture 11 More IP Networking. Fall 2011

Each ICMP message contains three fields that define its purpose and provide a checksum. They are TYPE, CODE, and CHECKSUM fields.

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

ICS 451: Today's plan

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

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

Network layer: Overview. Network Layer Functions

The Internetworking Problem. Internetworking. A Translation-based Solution

The Internet Protocol. IP Addresses Address Resolution Protocol: IP datagram format and forwarding: IP fragmentation and reassembly

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

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

ICMP (Internet Control Message Protocol)

Internetwork Protocols

ET4254 Communications and Networking 1

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

Master Course Computer Networks IN2097

EP2120 Internetworking/Internetteknik IK2218 Internets Protokoll och Principer

Internet Control Message Protocol (ICMP)

Subnets. IP datagram format. The Internet Network layer. IP Fragmentation and Reassembly. IP Fragmentation & Reassembly. IP Addressing: introduction

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.

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

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

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP

Chapter 4: Network Layer

Your Name: Your student ID number:

Chapter 4 Network Layer

SEN366 (SEN374) (Introduction to) Computer Networks

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

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

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

(ICMP), RFC

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

Internet Technology 3/23/2016

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Lehrstuhl für Informatik 4 Kommunikation und verteilte Systeme. Auxiliary Protocols

Network Layer (4): ICMP

Dongsoo S. Kim Electrical and Computer Engineering Indiana U. Purdue U. Indianapolis

Interconnecting Networks with TCP/IP

IP - The Internet Protocol

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

internet technologies and standards

Internet Control Message Protocol (ICMP), RFC 792. Prof. Lin Weiguo Copyleft 2009~2017, School of Computing, CUC

IPv4. Christian Grothoff.

The Interconnection Structure of. The Internet. EECC694 - Shaaban

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

Chapter 5 OSI Network Layer

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

IP : Internet Protocol

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

Chapter 5 TCP/IP SUITE

Topics for This Week

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

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

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

4. Basic IP Support Protocols

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

Lecture 4 - Network Layer. Transport Layer. Outline. Introduction. Notes. Notes. Notes. Notes. Networks and Security. Jacob Aae Mikkelsen

Lecture 4 The Network Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CHAPTER-2 IP CONCEPTS


CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

Administrivia CSC458 Lecture 4 Bridging LANs and IP. Last Time. This Time -- Switching (a.k.a. Bridging)

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

Different Layers Lecture 20

Introduction to routing in the Internet

CSEP 561 Internetworking. David Wetherall

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

TDTS06: computer Networks

EEC-684/584 Computer Networks

2/22/2008. Outline Computer Networking Lecture 9 IP Protocol. Hop-by-Hop Packet Forwarding in the Internet. Internetworking.

Internetworking/Internetteknik, Examination 2G1305 Date: August 18 th 2004 at 9:00 13:00 SOLUTIONS

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

CCNA Exploration Network Fundamentals. Chapter 06 Addressing the Network IPv4

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

Part 4. Wide Area Networks (WAN)

Introduction to routing in the Internet

Configuring Routes on the ACE

Internet. Organization Addresses TCP/IP Protocol stack Forwarding. 1. Use of a globally unique address space based on Internet Addresses

Transcription:

The Network Layer 1

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

Contents Connection-Oriented (virtual circuit) and Connectionless Service (datagram service) The IP Protocol IP-Support Protocols Routing Algorithms Congestion Control 3

4.1.1 Connection-Oriented and Connectionless Service Network layers can offer two types of service to the transport layer: Connection-oriented service (virtual circuit) Connection setup required before communication begins Network layer provides the Transport layer with a reliable service: in-sequence delivery, flow control Connectionless service (datagram service) No prior connection setup required Packets are stored and forwarded one at a time by IMPs 4

4.1.1 Connection-Oriented Service How to provide connection-oriented service: Set up a route (virtual circuit) between source and destination That route is used for all traffic flowing over the virtual circuit Switch maintains an internal table to tell which outgoing line to forward packet on for each active virtual circuit Packets must contain a virtual circuit number so that the switch can figure out how to forward them 5

Connection-Oriented Service: Analogy Public Telephone Network Set up a virtual circuit (dial a number) Transmit data on the circuit (conversation) Close down the virtual circuit (hang up) Two users are provided with the illusion of a dedicated point-to-point channel Information is delivered to the receiver in the same order in which it is transmitted by the sender 6

Connectionless Service How to provide connectionless service: Send the packet into the network and allow the network to forward it however it likes Switches maintain routing tables to look up the next switch for each arriving packet Each packet must contain a destination address so the switches can make routing decisions 7

Connectionless Service: An Analogy Postal service: Each packet (letter) is transported as an individual entity Each packet (letter) must carry the complete destination address If a packet (letter) is lost, error control is the user s responsibility Packets (letters) do not necessarily arrive in the order sent 8

4.1.2 Comparison between Connectionless and Connection- Oriented Services Connection Setup Procedure: Connection-oriented service Explicit setup and tear-down required For short transaction oriented communication, the delay of connection setup may be expensive Connectionless service No setup or tear-down required For long continuous communication, the overhead of packet headers may be expensive 9

Comparison (cont d) Header Overhead Connection-oriented service Only the virtual circuit number Connectionless service The full destination address is required 10

Comparison (cont d) Message Sequence: Connection-oriented service Sequence of packets automatically maintained Connectionless service Destination may have to re-sequence out-oforder packets 11

Comparison (cont d) Robustness Connection-oriented service Vulnerable: If a switch crashes, all virtual circuits passing through it have to be aborted and re-established Connectionless service Robust: If a router goes down, only hosts whose packets were queued at the time of the crash are lost. Other packets will be rerouted dynamically. 12

Comparison (cont d) Guaranteed service: Connection-oriented service Can provide guarantees on the delays and throughput of packets being sent Connectionless service It is very difficult to provide guarantees for timely packet delivery 13

Summary Connection-oriented service Is useful for applications which prefer insequence delivery of packets. It is also preferable for applications that require guaranteed service Connectionless service Provides flexibility in the routing and handling of individual packets and is robust in the face of router crashes 14

4.4 The Internet Protocol (IP) Provides delivery of packets from one host in the Internet to any other host in the Internet, even if the hosts are on different networks Internet packets are called datagrams and may be up to 64 kilobytes in length (although they are typically much smaller) Internet IMPs are known as routers and they operate in a connectionless mode 15

4.4.1 IP Packet Format Ver. IHL Identification Type of Serv. 32 bits D F M F Fragment Offset Time to Live Protocol Header checksum Source address Destination address Options (0 or more 32-bit words) Total Length Data (0 to 65,515 bytes) 16

IP Packet Fields Version IHL The IP version number (currently 4) IP Header Length in 32-bit words Type of Service Contains priority information, rarely used Total Length The total length of the datagram in bytes Includes header 17

IP Packet Fields (cont d) Identification DF MF When an IP packet is segmented into multiple fragments, each fragment is given the same identification This field is used to reassembly fragments Don t Fragment More Fragments When a packet is fragmented, all fragments except the last one have this bit set 18

IP Packet Fields (cont d) Fragment offset The fragment s position within the original packet Time to Live Hop count, decremented each time the packet reaches a new router When hop count = 0, packet is discarded Protocol Identifies which transport layer protocol is being used for this packet Header Checksum Verifies the contents of the IP header Not polynomial-based 19

IP Packet Fields (cont d) Source and Destination Addresses Uniquely identify sender and receiver of the packet Options Up to 40 bytes in length Used to extend functionality of IP Examples: source routing, security, record route 20

IP Addresses 32 bits long Notation: Each byte is written in decimal in MSB order, separated by decimals Example: 128.195.1.80 Address Classes Class A, B, C, D, E Loopback Broadcast 21

IP Address Classes Class 32 bits A 0 Net 24 bit Type of Serv. Host B 16 bit 10 Net Host C 110 Net 8 bit Host D 1110 Multicast address E 11110 Reserved 22

IP Address Classes Class A: For very large organizations 16 million hosts allowed Class B: For large organizations 65 thousand hosts allowed Class C For small organizations 255 hosts allowed Class D Multicast addresses No network/host hierarchy 23

Example Class A 1.0.0.0 to 126.0.0.0 Class B 128.1.0.0 191.255.0.0 Class C 192.0.1.0 223.2555.255.0 Class D 224.0.0.0 239.255.255.255 Class E 240.0.0.0 to 255.255.255.254 All 0s, (this host) all 0 s for the network part All 1s, limited broadcast Net.id, host id all 1s directed broadcast for the network 127.x.y.z (often 1s) is used for loopback within the same host 24

IP Address Hierarchy Note that Class A, Class B, and Class C addresses only support two levels of hierarchy Each address contains a network and a host portion, meaning two levels of hierarchy However, the host portion can be further split into subnets by the address class owner This allows for more than 2 levels of hierarchy 25

Subnetting Example: Class B address with 8-bit subnetting 16 bits 8 bits 8 bits Network id Subnet id Host id Example Address: 165.230.24.8 26

Subnet Masks Subnet masks allow hosts to determine if another IP address is on the same subnet or the same network 16 bits 8 bits 8 bits Network id Subnet id Host id Mask: 1111111111111111 11111111 00000000 255.255.255.0 27

Subnet Masks (cont d) Assume IP addresses A and B share subnet mask M. Are IP addresses A and B on the same subnet? 1. Compute (A and M). 2. Compute (B and M). 3. If (A and M) = (B and M) then A and B are on the same subnet. Example: A and B are class B addresses A = 165.230.82.52 Same network? B = 165.230.24.93 Same subnet? M = 255.255.255.0 28

Example Default netmasks Class A 98.0.0.0 (16 M hosts for each address) 255.0.0.0 net mask Class B 140.14.0.0 (64K hosts for each address) 255.255.0.0 net mask Class C address 192.6.8.0 (256 hosts for each address) 255.255.255.0 29

Example Subnetting allows subdivision of a network A rotorouter company is given 201.70.64.0 wants 8 subnets What is the subnet mask? How many host per subnet? 30

Example A bachelorette company is granted an address 181.56.0.0 The company needs 1000 subnets What is the subnet mask How many host per subnet 31

Variable length subnetting Assume a company wants to have five subnets with 60, 60, 60, 30, 30 hosts Subnet masks allow power of 2 subnets Use a hierarchy of routers to allow subnets to be divided with different subnet masks Another approach: Variable length subnet masks or use two different subnet masks 255.255.255.192 for the first three and the fourth is subdivided into 2 more with 255.255.255.224 32

Variable length subnetting 64 (60) 64 (60) 64(60) 32 (60) 32 (60) 255.255.255.192 255.255.255.192 255.255.255.192 255.255.255.224 255.255.255.224 L0 L1 L2 L3 L4 33

2.3 IP Routing How do you get a packet from one network to another?? A B C D W X Y Z 34

IP Routing (cont d) Case 1: Single hop Answer: with a router (or a series of routers) R A B C D W X Y Z Case 2: Multi-hop R Network Cloud R A B C D W X Y Z 35

Example R1 R2 R3 N1 N2 N3 N4 Routing table @ R2 Dest N1 N2 N3 N4 Next hop R1 Deliver directly Deliver directly R3 Actual routing table contains IP addresses, Flags indicating type of entries, net mask etc. (see Stevens pg. 113, sect 9.2) 36

Searching the routing table First, search for a matching host address Flag H is set Second, search for a matching network address Need to know the number of bits to use for network ID Third, search for a default entry Execute netstat -rn on your machine and find the contents of the routing table Default entry allows for a single entry for a list of entries that have the same next-hop value 37

IP Support Protocols ARP RARP ICMP 38

ARP Address Resolution Protocol Returns a MAC sublayer address when given an Internet address Commonly used in broadcast LANs so that two hosts can communicate using IP addresses instead of MAC sublayer addresses 39

ARP (cont d) ARP packet containing 128.195.1.38? ARP Ethernet Address: 05:23:f4:3d:e1:04 IP Address: 128.195.1.20 Wants to transmit to 128.195.1.38 Ethernet Address: 12:04:2c:6e:11:9c IP Address: 128.195.1.122 Ignored Ethernet Address: 98:22:ee:f1:90:1a IP Address: 128.195.1.38 Answered 40

ARP (cont d) ARP response packet containing 98:22:ee:f1:90:1a Repl Ethernet Address: 05:23:f4:3d:e1:04 IP Address: 128.195.1.20 Ethernet Address: 12:04:2c:6e:11:9c IP Address: 128.195.1.122 Ethernet Address: 98:22:ee:f1:90:1a IP Address: 128.195.1.38 41

RARP Reverse Address Resolution Protocol RARP performs the inverse action of ARP RARP returns an IP address for a given MAC sublayer address Operationally, RARP is the same as ARP 42

ICMP Internet Control Message Protocol Handles special Internet control functions Responsibilities: Reporting unreachable destinations Reporting IP packet header problems Reporting routing problems Reporting echoes (pings) 43

ICMP Protocol for error detection and reporting tightly coupled with IP, unreliable ICMP messages delivered in IP packets ICMP functions: Announce network errors Announce network congestion Assist trouble shooting Announce timeouts 44

ICMP MSG IP header Source, Destination Address, TTL,... ICMP MSG Message type, Code, Checksum, Data Message type examples (Figure 6.3 in Stevens book): 0 (8) echo request (reply) 3 destination unreachable 4 source quench 11 time exceeded 45

Specific uses of ICMP Echo request reply Can be used to check if a host is alive Address mask request/reply Learn the subnet mask Destination unreachable Invalid address and/or port TTL expired Routing loops, or too far away 46

Ping Uses ICMP echo request/reply Source sends ICMP echo request message to the destination address Echo request packet contains sequence number and timestamp Destination replies with an ICMP echo reply message containing the data in the original echo request message Source can calculate round trip time (RTT) of packets If no echo reply comes back then the destination is unreachable 47

Ping (cont d) A R1 R2 R3 B Echo request Time Echo reply 48

Traceroute Traceroute records the route that packets take A clever use of the TTL field When a router receives a packet, it decrements TTL If TTL=0, it sends an ICMP time exceeded message back to the sender To determine the route, progressively increase TTL Every time an ICMP time exceeded message is received, record the sender s (router s) address Repeat until the destination host is reached or an error message occurs 49

Traceroute (cont d) A TTL=1, Dest = B, port = invalid Te (R1) R1 R2 R3 Te = Time exceeded Pu = Port unreachable B Time TTL=2, Dest = B TTL=3, Dest = B Te (R2) Te (R3) TTL=4, Dest = B Pu (B) 50