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

Similar documents
Network layer: Overview. Network Layer Functions

Network Layer: Internet Protocol

Router Architecture Overview

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

Chapter 4: Network Layer

Master Course Computer Networks IN2097

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

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 12

internet technologies and standards

Computer Networking Introduction

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

Internet Network Protocols IPv4/ IPv6

CMPE 80N: Introduction to Networking and the Internet

Hierarchical Routing. Our routing study thus far - idealization all routers identical network flat no true in practice. administrative autonomy

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

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

Quiz. Segment structure and fields Flow control (rwnd) Timeout interval. Phases transition ssthresh setting Cwnd setting

CSC 4900 Computer Networks: Network Layer

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

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

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

1-1. Switching Networks (Fall 2010) EE 586 Communication and. October 25, Lecture 24

Lecture 3. The Network Layer (cont d) Network Layer 1-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

internet technologies and standards

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Chapter 4: network layer. Network service model. Two key network-layer functions. Network layer. Input port functions. Router architecture overview

TDTS06: computer Networks

CS 43: Computer Networks. 21: The Network Layer & IP November 7, 2018

CSC 401 Data and Computer Communications Networks

CSCI Computer Networks Fall 2016

COMP211 Chapter 4 Network Layer: The Data Plane

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

Δίκτυα Υπολογιστών ΙΙ. Κώστας Μαγκούτης Επίκουρος Καθηγητής Τμήμα Μηχανικών Η/Υ και Πληροφορικής Πανεπιστήμιο Ιωαννίνων

RSC Part II: Network Layer 3. IP addressing (2nd part)

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 4 Network Layer: The Data Plane

Network Layer: Control/data plane, addressing, routers

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer: The Data Plane

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

CSCD58 WINTER 2018 WEEK 6 - NETWORK LAYER PART 1. Brian Harrington. February 13, University of Toronto Scarborough

Lecture 5 The Network Layer part II. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

IPv4. Christian Grothoff.

Chapter 4 Network Layer

Chapter 4 Network Layer

ECE 4450:427/527 - Computer Networks Spring 2017

Introduction to Computer Networking. Guy Leduc. Chapter 4 Network Layer: The Data Plane. Chapter 4: Network Layer Data Plane

Chapter 4 Network Layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 13

Network Layer: Router Architecture, IP Addressing

COSC4377. TCP vs UDP Example Statistics

NETWORK LAYER DATA PLANE

Chapter 4 Network Layer

IPv4 addressing, NAT. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.

Network Layer: Data Plane 4-2

Data Communications & Networks. Session 7 Main Theme Networks: Part I Circuit Switching, Packet Switching, The Network Layer

Network Layer: DHCP, ICMP, NAT, IPv6

Different Layers Lecture 20

Lecture 16: Network Layer Overview, Internet Protocol

HY 335 Φροντιστήριο 8 ο

Chapter 4 Network Layer: The Data Plane

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

CS 3516: Advanced Computer Networks

Outline. IP Address. IP Address. The Internet Protocol. o Hostname & IP Address. o The Address

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

Chapter 4: Network Layer

Vorlesung Kommunikationsnetze

CS 457 Lecture 11 More IP Networking. Fall 2011

Network Layer II. Getting IP addresses. DHCP client-server scenario. DHCP client-server scenario. C compiler. You writing assignment 2

CSC358 Week 6. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

CS 3516: Advanced Computer Networks

Chapter 4 Network Layer: The Data Plane

Chapter 5. The Network Layer IP

The Network Layer Forwarding Tables and Switching Fabric

CSCE 463/612 Networks and Distributed Processing Spring 2017

CSCI-1680 Network Layer: IP & Forwarding John Jannotti

Network layer. Network Layer 4-1. application transport network data link physical. network data link physical. network data link physical

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

Lecture 17: Network Layer Addressing, Control Plane, and Routing

Network layer Network Layer 4-1

EECS 3214: Computer Networks Protocols and Applications

CSC 401 Data and Computer Communications Networks

Network layer. Key Network-Layer Functions. Network service model. Interplay between routing and forwarding. CSE 4213: Computer Networks II

CSEP 561 Internetworking. David Wetherall

Network layer: Overview. Network layer functions Routing IP Forwarding

Chapter 4 Network Layer. Network Layer 4-1

TCP/IP Protocol Suite

Lecture 8. Reminder: Homework 3, Programming Project 2 due on Thursday. Questions? Tuesday, September 20 CS 475 Networks - Lecture 8 1

Internet Protocol (IP)

CS 348 Computer Networks. IP and Routing. Indian Institute of Technology, Bombay

Chapter 4 Network Layer

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

Network Layer: Chapter 4. The Data Plane. Computer Networking: A Top Down Approach

Lecture 8. Basic Internetworking (IP) Outline. Basic Internetworking (IP) Basic Internetworking (IP) Service Model

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer: The Data Plane

Internet Protocols (chapter 18)

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

Transcription:

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

Network Layer Functions Transport packet from sending to receiving hosts Network layer protocols in every host, router application transport network data link physical network data link physical network data link physical network data link physical Three important functions: Path determination: route taken by packets from source to dest. Routing algorithms network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical Switching: move packets from router s input to appropriate router output 2

IP addressing IP address: 32-bit identifier for host, router interface Interface: connection between host, router and physical link routers typically have multiple interfaces host may have multiple interfaces IP addresses associated with interface, not host, router 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.1.3 223.1.3.27 223.1.2.3 223.1.3.1 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 3

IP addressing (2) IP address: Network part (high order bits) Host part (low order bits) What s a network? (from IP address perspective) Device interfaces with same network part of IP address Can physically reach each other without intervening router 223.1.1.1 223.1.1.2 223.1.2.1 223.1.1.4 223.1.2.9 223.1.1.3 223.1.3.1 223.1.3.27 LAN 223.1.2.2 223.1.3.2 Network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) 4

IP addressing (3) How to find the networks? Detach each interface from router, host Create islands of isolated networks 223.1.1.1 223.1.1.2 223.1.1.3 223.1.9.2 223.1.7.0 223.1.1.4 223.1.9.1 223.1.8.1 223.1.8.0 223.1.7.1 223.1.2.6 223.1.3.27 Interconnected system consisting of six networks 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 5

IP networks: Subnets Sub divide address space network part host address Address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part 11001000 00010111 00010000 00000000 200.23.16.0/24 host part 6

Fixed subnetting (classful) class A B C D 0network host 10 network host 110 network host 1110 multicast address 32 bits 1.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255 7

Address management Problem: We are running out of networks Solution (a): Subnetting: e.g., Class B Host field (16 bits) is subdivided into <subnet;host> fields Solution (b): CIDR (Classless Inter Domain Routing) 8

CIDR CIDR: Classless InterDomain Routing Motivation Class A is too large, Class C is too small Everyone had a Class B address!!! Solution: Sites are given contiguous blocks of class-c addresses (256 addresses each) and a mask or parts of former class A/B networks. 9

CIDR (2.) CIDR: Classless InterDomain Routing> Subnet portion of address of arbitrary length Address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part 11001000 00010111 00010000 00000000 200.23.16.0/23 host part 10

IP addresses: How to get one? Q: How does host get IP address? Hard-coded by system admin in a file Wintel: Control Panel Network Configuration TCP/IP Properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server Plug-and-play IP / Subnets allocated by provider (RIPE/ARIN/ ) 11

Hierarchical address structure Recall: CIDR 18 relevant bits 128.119.48.12/18 = 10000000 01110111 00110000 00001100 High order bits form the prefix Once inside the network, can subnet: divide remaining bits Subnet example: 129.128.0.0/10 129.160.0.0/12 129.176.0.0/14 129.188.0.0/14 Note: picture shows prefix masks, not interface addrs! Forwarding decision: Longest prefix match 12

Forwarding vs. routing Forwarding: the process of moving packets from input to output The forwarding table Information in the packet Routing: process by which the forwarding table is built and maintained One or more routing protocols Procedures (algorithms) to convert routing info to forwarding table. (More later ) 13

Forwarding with CIDR Packet should be sent toward the interface with the longest matching prefix Advertised addresses 1000 1101 0110 1000 110 1000 1101 00 1000 0110 1000 1100 1101 1000 1101 0011 1000 1101 1000 1101 001 14

CIDR (3.) Repeated aggregation within same provider leads to shorter and shorter prefixes CIDR helps also routing table size and processing: Gateways keep only prefixes and find longest prefix match Class-C networks are also partitioned by geography e.g., Europe got 194.0.0.0 to 195.255.255.255 15

Lookup: Longest prefix match Forwarding table: <Network>/<mask> <next-hop> IP Packets: destination IP address Find next-hop via longest prefix match Example: Forwarding table Packets 134.96.252.0/24 A 134.96.252.200 134.96.0.0/16 C 134.96.254.2 134.96.240.0/20 B 134.96.239.200 134.96.252.192/28 B 134.97.239.200 134.96.252.128/28 A 134.96.252.191 16

IP addressing: The last word Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes Q: What do I do if I don t have a public address? A: Private IP addresses (RFC 1918) 10/8 172.16/12 192.168/16 Private use only not routable in the Internet 17

NAT: Network address translation Motivation: Local network uses just one IP address as far as outside world is concerned: Just one IP address for all devices Not needed range of addresses from ISP 18

NAT: Network address translation (2.) rest of Internet 138.76.29.7 10.0.0.4 local network (e.g., home network) 10.0.0/24 10.0.0.1 10.0.0.2 10.0.0.3 All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) 19

NAT: Network address translation (3.) Motivation: Local network uses just one IP address as far as outside world is concerned: Range of addresses not needed from ISP: just one IP address for all devices Can change addresses of devices in local network without notifying outside world Can change ISP without changing addresses of devices in local network Devices inside local net not explicitly addressable, visible by outside world (a security plus). 20

NAT: Network address translation (4.) Implementation: NAT router must: Outgoing datagrams: Replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)... remote clients/servers will respond using (NAT IP address, new port #) as destination addr. Remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair Incoming datagrams: Replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table 21

NAT: Network address translation (5.) 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table 2 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 10.0.0.4 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 10.0.0.1 10.0.0.2 138.76.29.7 S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: Reply arrives dest. address: 138.76.29.7, 5001 S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345 22

NAT: Network address translation (6.) 16-bit port-number field: 60,000 simultaneous connections with a single LANside address! NAT is controversial: Routers should only process up to layer 3 Violates end-to-end argument NAT possibility must be taken into account by app designers, e.g., P2P applications Address shortage should instead be solved by IPv6 23

IPv4 Datagram Format IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to ver head. len 16-bit identifier time to live type of service upper layer 32 bits flgs length fragment offset Internet checksum 32 bit source IP address 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) total datagram length (bytes) for fragmentation/ reassembly E.g. timestamp, record route taken, specify list of routers to visit. 24

IP fragmentation and reassembly Network links have MTU (max. transfer size) largest possible link-level frame. Different link types, different MTUs Large IP datagram divided ( fragmented ) within net One datagram becomes several datagrams Reassembled only at final destination IP header bits used to identify, order related fragments reassembly fragmentation: in: one large datagram out: 3 smaller datagrams 25

IP fragmentation and reassembly (2.) Example 4000 byte datagram MTU = 1500 bytes length =4000 ID =x fragflag =0 offset =0 One large datagram becomes several smaller datagrams 1480 bytes in data field offset = 1480/8 length =1500 length =1500 length =1040 ID =x ID =x ID =x fragflag =1 fragflag =1 fragflag =0 offset =0 offset =185 offset =370 26

ICMP: Internet control message protocol Used by hosts, routers, gateways to communication network-level information Error reporting: unreachable host, network, port, protocol Echo request/reply (used by ping) Network-layer above IP: ICMP msgs carried in IP datagrams ICMP message: Type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header 27

Address resolution protocol (ARP) Interface between Link layer and Network Layer Allows hosts to query who owns an IP address on the same LAN Owner responds with hardware address Allows changes to link layer to be independent of IP addressing 28

Network layer: Status Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing 29