Advanced Computer Networking (ACN)

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

Master Course Computer Networks IN2097

internet technologies and standards

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

Network layer: Overview. Network Layer Functions

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

Router Architecture Overview

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

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

Chapter 4: Network Layer

CSCI Computer Networks Fall 2016

Network Layer: Internet Protocol

IPv4. Christian Grothoff.

Network Layer PREPARED BY AHMED ABDEL-RAOUF

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

TSIN02 - Internetworking

Lecture 8. 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

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

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

internet technologies and standards

Computer Networking Introduction

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

Network layer Network Layer 4-1

Internetworking Part 2

ECE 4450:427/527 - Computer Networks Spring 2017

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

Chapter 4 Network Layer

TSIN02 - Internetworking

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

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

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

CSC 401 Data and Computer Communications Networks

CS 457 Lecture 11 More IP Networking. Fall 2011

Vorlesung Kommunikationsnetze

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

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

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

The Interconnection Structure of. The Internet. EECC694 - Shaaban

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

TDTS06: computer Networks

Introduction to routing in the Internet

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

CS 3516: Advanced Computer Networks

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

SEN366 (SEN374) (Introduction to) Computer Networks

Introduction to routing in the Internet

Topics for This Week

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

Chapter 4 Network Layer: The Data Plane

Module 7 Internet And Internet Protocol Suite

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

Network Layer: Control/data plane, addressing, routers

EEC-684/584 Computer Networks

ROUTING INTRODUCTION TO IP, IP ROUTING PROTOCOLS AND PROXY ARP

ICS 451: Today's plan

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

RSC Part II: Network Layer. 3. IP addressing. II.5 Network routing. II. 1 Basic Network layer concepts II.2 Introduction to IP

Inter-networking. Problem. 3&4-Internetworking.key - September 20, LAN s are great but. We want to connect them together. ...

ICMP (Internet Control Message Protocol)

(ICMP), RFC

Internetworking Part 2

Chapter 4 Network Layer

IP Protocols. ALTTC/Oct

Lecture 20: Link Layer

Lecture 16: Network Layer Overview, Internet Protocol

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

Exercise Sheet 4. Exercise 1 (Routers, Layer-3-Switches, Gateways)

CS475 Networks Lecture 8 Chapter 3 Internetworking. Ethernet or Wi-Fi).

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

Network Layer (4): ICMP

CCNA Exploration Network Fundamentals. Chapter 06 Addressing the Network IPv4

Networks. an overview. dr. C. P. J. Koymans. Informatics Institute University of Amsterdam. February 4, 2008

History Page. Barracuda NextGen Firewall F

Agenda L2 versus L3 Switching IP Protocol, IP Addressing IP Forwarding ARP and ICMP IP Routing First Hop Redundancy

CIS 551 / TCOM 401 Computer and Network Security

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

Internet Technology 3/23/2016

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

COMP211 Chapter 4 Network Layer: The Data Plane

CIS 551 / TCOM 401 Computer and Network Security. Spring 2006 Lecture 16

Chapter 4: Network Layer

CSC 4900 Computer Networks: Network Layer

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

(Chapters 2 3 in Huitema) E7310/Internet basics/comnet 1

Computer Networks Principles Network Layer - IP

Address Resolution Protocol (ARP), RFC 826

Internet Control Message Protocol (ICMP)

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

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

Information Network Systems The network layer. Stephan Sigg

Internet Protocols (chapter 18)

Chapter 4 Network Layer

TCP/IP Networking. Training Details. About Training. About Training. What You'll Learn. Training Time : 9 Hours. Capacity : 12

CSC 401 Data and Computer Communications Networks

Data Communication & Computer Networks Week # 13

Chapter 4 Network Layer

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

Transcription:

Chair of Network Architectures and Services Department of Informatics Technical University of Munich Advanced Computer Networking (ACN) IN2097 WiSe 2017-2018 Prof. Dr.-Ing. Georg Carle Sebastian Gallenmüller, Johannes Naab, Stephan Günther, Fabien Geyer Chair of Network Architectures and Services Department of Informatics Technical University of Munich

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-1

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-2

Network layer Network layer Hi! Application Application Hi! PH Hi! Presentation Presentation PH Hi! Session Session TH PH Hi! Transport Transport TH PH Hi! NH TH PH Hi! Network Network Network NH TH PH Hi! LH NH TH PH Hi! LT Data Link Data Link Data Link Data Link LH NH TH PH Hi! LT Physical Physical Physical Physical Host A Switch Switch Host B Chapter 3: Internet Protocol v4 Network layer 3-3

Network layer Host or router network layer functions IP protocol addressing conventions datagram format packet handling conventions Routing protocols path selection RIP, OSPF, BGP ICMP protocol error reporting router signaling Chapter 3: Internet Protocol v4 Network layer 3-4

Network layer IPv4 datagram [1] Offset 0 B 4 B 8 B 12 B 16 B 20 B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Version IHL TOS Total Length Identification Flags Fragment Offset TTL Protocol Header Checksum Source Address Destination Address Options / Padding (optional) Abbreviations: IHL: Internet Header Length TOS: Type Of Service TTL: Time To Live Chapter 3: Internet Protocol v4 Network layer 3-5

Network layer IP protocol model Many application specific protocols over IP IP (with best effort service model) over many media specific LAN protocols Hourglass model of IP QoS support (RSVP, DiffServ) added to IP as an afterthought Chapter 3: Internet Protocol v4 Network layer 3-6

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-7

Internet addressing IPv4 addressing 10.0.10.214 10.0.10.2 10.0.10.21 IP address: 32-bit identifier for host, router interface Address space: 4.3 billion IPv4 addresses in theory Interface: connection between host/router and physical link IP addresses associated with each interface 10.0.10.1 192.168.128.1 192.168.128.68 192.168.128.3 IP address formatting: 4 numbers from 0 to 255 separated by dots Chapter 3: Internet Protocol v4 Internet addressing 3-8

Internet addressing Subnets 10.0.10.214 10.0.10.2 10.0.10.21 What is a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening router 10.0.10.1 192.168.128.1 192.168.128.68 192.168.128.3 network with 2 subnets Chapter 3: Internet Protocol v4 Internet addressing 3-9

Internet addressing Subnets 10.0.10.214 10.0.10.2 10.0.10.21 What is a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening router How to determine? Detach interfaces from host or router 10.0.10.1 192.168.128.1 192.168.128.68 192.168.128.3 network with 2 subnets Chapter 3: Internet Protocol v4 Internet addressing 3-9

Internet addressing Subnets What is a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening router How to determine? Detach interfaces from host or router Splitting IP addresses Network part: Addressing the network Host part: Addressing the interface of a host 10.0.10.214 10.0.10.2 10.0.10.21 10.0.10.1 192.168.128.1 192.168.128.68 192.168.128.3 network with 2 subnets 192 10. 168 10. 128 10. 1 10 = 1100000 2.10101000 2.1 2 0000000 2.00000001 2 network part host part Chapter 3: Internet Protocol v4 Internet addressing 3-9

Internet addressing Classful IP addresses (historic) Used from 1981 to 1993 IPv4 address 32 bit Class A Class B Class C Class D Class E 0... network host 10... network host 110... network host 1110... multicast address 1111... reserved class start address end address relative portion A 0.0.0.0 to 127.255.255.255 50.00 % B 128.0.0.0 to 192.255.255.255 25.00 % C 192.0.0.0 to 223.255.255.255 12.50 % D 224.0.0.0 to 239.255.255.255 6.25 % E 240.0.0.0 to 255.255.255.255 6.25 % Chapter 3: Internet Protocol v4 Internet addressing 3-10

Internet addressing Classless IP addresses CIDR: Classless InterDomain Routing (introduced in 1993, RFC 1519) Idea: intoduction of arbitrary subnet length Address format: a.b.c.d/x, where x corresponds to the number of bits in subnet portion of address Chapter 3: Internet Protocol v4 Internet addressing 3-11

Internet addressing Example: CIDR How to calculate the network address for 192.168.128.1 and with a prefix length of 17 bits? CIDR notation: 192.168.128.1/17 Dotted decimal notation: 192.168.128.1/255.255.128.0 host address 10 192 10. 168 10. 128 10. 1 10 host address 2 11000000 2.10101000 2.10000000 2.00000001 2 network mask & 11111111 2.11111111 2.10000000 2.00000000 2 network address 2 11000000 2.10101000 2.10000000 2.00000000 2 network address 10 192 10. 168 10. 128 10. 0 10 Chapter 3: Internet Protocol v4 Internet addressing 3-12

Internet addressing Classful vs. CIDR Classful: A B C D E 0 2 32 1 Chapter 3: Internet Protocol v4 Internet addressing 3-13

Internet addressing Classful vs. CIDR Classful: A B C D E 0 2 32 1 CIDR: 0.0.0.0/5 64.0.0.0/5 128.0.0.0/6 192.168.128.0/17 0 2 32 1 Chapter 3: Internet Protocol v4 Internet addressing 3-13

Internet addressing Classful vs. CIDR Classful: A B C D E 0 2 32 1 CIDR: 0.0.0.0/5 64.0.0.0/5 128.0.0.0/6 192.168.128.0/17 0 2 32 1 192.168.128.1 Chapter 3: Internet Protocol v4 Internet addressing 3-13

Internet addressing Current usage of IPv4 addresses 1 A Spatiotemporal View of the Address Space time Nov 1997 Jun 2006 Feb 2015 mainly LEGACY mainly ALLOCATED mainly LEGACY mainly ALLOCATED 0. 64. 128. 192. 255. former address spaceformer former class A class B class C RESERVED no IPs routed all IPs routed Philipp Richter INET / TU Berlin 16 1 Philipp Richter et al. A primer on ipv4 scarcity. In: ACM SIGCOMM Computer Communication Review 45.2 (2015), pp. 21 31 Chapter 3: Internet Protocol v4 Internet addressing 3-14

Internet addressing IPv4 address exhaustion IPv4 addresses are rare a resource nowadays Inefficiency of Classful: Class C (256 addresses) too small for small enterprises Class B (65536 addresses) too small for large enterprises or universities Class A (16 million addresses) too large Rise of Internet-connected devices: personal computers, mobile phones, Internet-of-Things,... Always-on devices: Sharing of IPv4 addresses become less viable Various solutions proposed, the most notable one being private addresses: 10.0.0.0/8-24-bit block 172.16.0.0/12-20-bit block 192.168.0.0/16-16-bit block Chapter 3: Internet Protocol v4 Internet addressing 3-15

Internet addressing Acknowledgements Jim Kurose, University of Massachusetts, Amherst Keith Ross, Polytechnic Institute of NYC Olivier Bonaventure, University of Liege Srinivasan Keshav, University of Waterloo Chapter 3: Internet Protocol v4 Internet addressing 3-16

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-17

ICMP Internet Control Message Protocol (ICMP) RFC 792 [2] Network layer above IP: ICMP messages carried in IP datagrams Can be considered part of the IP layer Communicates error messages and other conditions that require attention Error messages are acted on by either... IP layer, or TCP, or UDP Some ICMP messages cause errors to be returned to user processes Chapter 3: Internet Protocol v4 ICMP 3-18

ICMP ICMP message format Offset 0 B 4 B 8 B 12 B 16 B 20 B 24 B 28 B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Version IHL TOS (0x00 for ICMP) Total length Identification Flags Fragment offset TTL Protocol (0x0001 for ICMP) Header checksum Source address Destination address Type Code Checksum Type-dependent part of header Data (optional) IP header ICMP 15 different types. Some types use a code to further specify the condition Chapter 3: Internet Protocol v4 ICMP 3-19

ICMP ICMP message types Two classes of ICMP messages: Query messages Only kind of ICMP messages that generate another ICMP message Error messages Contain IP header and first 8 bytes of datagram that caused the ICMP error to be generated. Allows receiving ICMP module to associate the message with a particular protocol and process (port number) Chapter 3: Internet Protocol v4 ICMP 3-20

ICMP ICMP message types Cf. RFC 792 [2] type description 0 echo reply (ping) 3 destination unreachable (codes subsequent slide) 4 source quench (deprecated, RFC 6633) 5 redirect 8 echo request 9 router advertisement (MC, see RFC 1256) 10 router solicitation (MC, see RFC 1256) 11 time exceeded 12 parameter problem (bad IP header) 13 timestamp request 14 timestamp reply 15 info request 16 info reply 17 address mask request (see RFC 950) 18 address mask reply Chapter 3: Internet Protocol v4 ICMP 3-21

ICMP ICMP message types continued Cf. RFC 792 [2] type code description 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 Historically: ICMP content always contained IP header and first 8 bytes of IP payload that caused ICMP error message to be generated (RFC 792) Today: ICMP should contain as much data of the dropped message as possible up to a limit of 572 byte for the ICMP message (RFC 1812) Chapter 3: Internet Protocol v4 ICMP 3-22

ICMP Ping Checks if host is reachable, alive Uses ICMP echo request/reply Copy packet data request reply PING net. i n. tum. de (1 3 1.1 5 9.1 5.2 4 ) : 56 data bytes 64 bytes from 131.159.15.24: icmp_seq=0 t t l =63 time =4.033 ms 64 bytes from 131.159.15.24: icmp_seq=1 t t l =63 time =13.310 ms 64 bytes from 131.159.15.24: icmp_seq=2 t t l =63 time =58.955 ms 64 bytes from 131.159.15.24: icmp_seq=3 t t l =63 time =7.143 ms ^C net. i n. tum. de ping s t a t i s t i c s 4 packets transmitted, 4 packets received, 0.0% packet loss round t r i p min / avg /max / stddev = 4.033/20.860/58.955/22.246 ms Listing 1: Sample output of ping Chapter 3: Internet Protocol v4 ICMP 3-23

ICMP Traceroute Allows to follow path taken by packet Send UDP/TCP/... packets with increasing TTL to unlikely port ICMP replies: time exceeded ; last ICMP message: port unreachable $ t r a c e r o u t e gaia. cs.umass.edu 1 s c y l l a (131.159.20.11) 4.263 ms 2.531 ms 2.162 ms 2 nz bb net. i n f o r m a t i k. tu muenchen de (131.159.252.149). 6.124 ms 15.174 ms 3.546 ms 3 nz csr1 kw5 bb1. informatik. tu muenchen. de (131.159.252.2) 2.925 ms 4.234 ms 3.033 ms 4 vl 3010.csr1 2wr. l r z. de (129.187.0.149) 5.082 ms 3.387 4.694 ms ms 5 cr gar1 be2 147.x win. dfn. de ( 1 8 8. 1. 3 7. ) 3.254 ms 3.274 ms 2.967 8 9 ms 6 cr fra2 hundredgige0 0 0 3.x win. dfn. de (188.1.144.253) 13.139 ms 12.260 ms 15.702 ms 7 dfn.mx1. f r a.de. geant. net (62.40.124.217) 11.365 ms 11.716 ms 16.314 ms 8 ae1.mx1.gen. ch. geant. net (62.40.98.108) 19.889 ms 26.193 ms 19.661 ms 9 ae4.mx1. par. f r. geant. net (62.40.98.152) 28.465 ms 27.664 ms 29.365 ms 10 et 3 1 0.102.rtsw. newy32aoa. net. i n t e r n e t. edu (198.71.45.236) 104.199 ms 2 104.173 ms 109.925 ms 11 nox300gw1 i2 re. nox. org ( 1 9 2. 5. 8 9. 2 2 1 ) 111.437 ms 110.232 ms 109.370 ms 12 umass re nox300gw1. nox. org ( 1 9 2. 5. 8 9. 1 ) 113.755 ms 115.848 ms 110.634 0 2 ms 13 core1 r t xe 0 0 0.gw. umass. edu (192.80.83.101) 118.469 ms 119.070 ms 114.279 ms 14 l g r c r t 106 8 po 10.gw. umass. edu (128.119.0.233) 111.948 ms 111.992 ms 111.616 ms 15 128.119.3.32 ( 1 2 8. 1 1 9. 3. 3 2 ) 112.194 ms 124.315 ms 111.624 ms 16 nscs1bbs1. cs.umass.edu (128.119.240.253) 114.384 ms 166.509 ms 113.220 ms 17 gaia. cs.umass.edu (128.119.245.12) 130.574 ms!z 114.883 ms!z 116.865 ms!z Listing 2: Sample output of traceroute Chapter 3: Internet Protocol v4 ICMP 3-24

ICMP Acknowledgements Jim Kurose, University of Massachusetts, Amherst Keith Ross, Polytechnic Institute of NYC Olivier Bonaventure, University of Liege Srinivasan Keshav, University of Waterloo Chapter 3: Internet Protocol v4 ICMP 3-25

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-26

ARP Connecting Link and Network Layer Hi! Application Application Hi! PH Hi! Presentation Presentation PH Hi! Session Session TH PH Hi! Transport Transport TH PH Hi! NH TH PH Hi! Network Network Network NH TH PH Hi! LH NH TH PH Hi! LT Data Link Data Link Data Link Data Link LH NH TH PH Hi! LT Physical Physical Physical Physical Host A Switch Switch Host B Chapter 3: Internet Protocol v4 ARP 3-27

ARP MAC Addresses and IP Addresses MAC (or LAN or physical or Ethernet) address L2 service: transmit frame from one interface to another physically-connected interface (same network) with specified destination address address length: 48 bit (for most LANs) burned into network adapter ROM, or software settable assumption: two hosts on the same LAN will not use the same Ethernet address IP address: network-layer address L3 service: get datagram to destination IP subnet / host I/F L3 address: has role of locator & identifier (vs. HIP Host Identity Protocol; LISP Locator/ID Separator Protocol) address length: 32 bit (IPv4) or 128 bit (IPv6) address separated into: network part (i.e. network identifier & locator) host part (i.e. host identifier) Chapter 3: Internet Protocol v4 ARP 3-28

ARP Address resolution Mapping between addresses of different layers Examples: IPv4 MAC MAC IPv4 Mapping from L3 host address to MAC address Needed to identify correct L2 adapter of L3 Address Resolution Protocol (ARP) Mapping from MAC address to L3 address Reverse Address Resolution Protocol (RARP) (rarely used) Chapter 3: Internet Protocol v4 ARP 3-29

ARP Addresses and names Example Organization MAC address 6C:40:08:BD:A5:B4 flat, permanent IP address 172.16.0.1 topological (mostly) Host name www.ietf.org hierarchical DNS, ARP, host name m to n IP address 1 to 1 MAC address Chapter 3: Internet Protocol v4 ARP 3-30

ARP Addressing: routing to another LAN Example send datagram from A to B via R (assuming A knows B s IP address) The router manages two ARP tables one for Net 1 and one for Net 2 A NIC F8-E0-79-E3-47-5A 10.0.10.5 NIC EA-2C-13-C2-0E-B8 10.0.10.8 172.16.0.1 NIC D3-B2-16-88-AA-FC 6A-5B-35-EA-82-80 NIC 172.16.0.7 Net 1 Net 2 NIC A2-D0-34-67-27-5B 10.0.10.1 R NIC B 00-00-5E-00-53-10 172.16.0.10 Chapter 3: Internet Protocol v4 ARP 3-31

ARP A creates IP datagram with source IP addr. A, destination IP addr. B A uses ARP to get R s MAC address of R s interface 10.0.10.1 A creates link-layer frame with R s MAC address as destination, frame contains A-to-B IP datagram A s NIC sends frame R s NIC receives frame R extracts IP datagram from Ethernet frame, sees it is destined to B R uses ARP to get B s MAC address R creates frame containing A-to-B IP datagram, sends it to B A NIC F8-E0-79-E3-47-5A 10.0.10.5 NIC EA-2C-13-C2-0E-B8 10.0.10.8 172.16.0.1 NIC D3-B2-16-88-AA-FC 6A-5B-35-EA-82-80 NIC 172.16.0.7 Net 1 Net 2 NIC A2-D0-34-67-27-5B 10.0.10.1 R NIC B 00-00-5E-00-53-10 172.16.0.10 Chapter 3: Internet Protocol v4 ARP 3-32

ARP ARP protocol: same LAN (network) A wants to send datagram to R s interface 10.0.10.1, while R s MAC address is not in A s ARP table. A broadcasts ARP query packet, containing R s IP address destination MAC address = FF-FF-FF-FF-FF-FF all hosts on LAN receive ARP query When R receives ARP packet, it replies to A with its (R s) MAC address frame sent to A s MAC address A caches IP-to-MAC address pair in its ARP table until information times out soft state: information that times out (goes away) unless refreshed ARP is plug-and-play : nodes create their ARP tables without intervention from network administrator Chapter 3: Internet Protocol v4 ARP 3-33

ARP ARP packet format Offset 0 B 4 B 8 B 12 B 16 B 20 B 24 B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Hardware Type Protocol Type Hardware Addr. Length Protocol Addr. Length Operation Sender Hardware Address (first 32 bit) Sender Hardware Address (last 16 bit) Sender Protocol Address (first 16 bit) Sender Protocol Address (last 16 bit) Target Hardware Address (first 16 bit) Target Hardware Address (last 32 bit) Target Protocol Address Chapter 3: Internet Protocol v4 ARP 3-34

ARP ARP details ARP supports different protocols at L2 and L3 any network protocol over any LAN/MAC protocol type and address length fields specified in ARP PDUs Reverse ARP (RARP) cf. RFC 903 (rarely used) L2 MAC fields (hardware) hardware type: 6 = IEEE802 (with LLC/SNAP) address length: 6 for a 48 byte MAC address sender hardware address (SHA) target hardware address (THA) L3 network fields (protocol) protocol type: IP = 0800 address length: 4 for IPv4 addr. sender protocol address (SPA) target protocol address (TPA) Operation Code 01: request 02: reply 03: reverse request 04: reverse reply (for RARP) cf. http://www.iana.org/assignments/arp-parameters Chapter 3: Internet Protocol v4 ARP 3-35

ARP Proxy ARP Proxy ARP: Host or router responds to ARP Request that arrives from one of its connected networks for a host that is on another of its connected networks. RFC 925: Multi-LAN Address Resolution NIC 10.0.1.5/24 LAN 1 10.0.1.0/24 10.0.2.1/24 NIC NIC LAN 2 10.0.2.0/24 NIC 10.0.2.7/24 NIC 10.0.1.1/24 NIC 10.0.1.8/24 10.0.2.10/24 Chapter 3: Internet Protocol v4 ARP 3-36

ARP Proxy ARP - possible uses Transparent subnet gatewaying Two LANs sharing same IP subnet, connected via router cf. RFC 1027 Using ARP to Implement Transparent Subnet Gateways Host joining LAN via dialup link Dialup router employs Proxy ARP Host joining LAN via VPN VPN server employs Proxy ARP Host separated via firewall Firewall employs Proxy ARP Chapter 3: Internet Protocol v4 ARP 3-37

ARP ARP optimizations When should a host send ARP requests? Before sending each IP packet? No, each host/router maintains ARP table (IP address MAC address mapping) ARP request is only sent in case there is no entry for this IP address in the ARP table. How to deal with hosts that change their addresses? Expiration timer is associated to each entry in the ARP table ARP table entry is removed upon timer expiration Some implementations send ARP request to revalidate before removing table entry Some implementations remember when ARP table entries were used to avoid removing important entries Chapter 3: Internet Protocol v4 ARP 3-38

ARP Things to know about ARP What happens if an ARP request is made for a non-existing host? Several ARP requests are made with increasing time intervals between requests Eventually, ARP gives up Gratuitous ARP Requests A host sends an ARP request for its own IP address Useful for detecting if an IP address has already been assigned. Chapter 3: Internet Protocol v4 ARP 3-39

ARP Vulnerabilities of ARP 1. Since ARP does not authenticate requests or replies, ARP requests and replies can be forged 2. ARP is stateless: ARP replies can be sent without a corresponding ARP request 3. According to the ARP protocol specification, a node receiving an ARP packet (request or reply) must update its local ARP cache with the information in the sender fields. Updates also happen if the receiving node already has an entry for the IP address of the sender in its ARP cache. (This applies for ARP Request packets and for ARP Reply packets) Typical exploitation of these vulnerabilities: A forged ARP request or reply can be used to update the ARP cache of a remote system with a forged entry (ARP Poisoning) This can be used to redirect IP traffic from/to other hosts ARP poisoning & ARP spoofing also can be performed by hosts within a WPA2-protected WLAN Chapter 3: Internet Protocol v4 ARP 3-40

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-41

Routing Routers vs. Switches Both store-and-forward devices routers: L3/network layer devices (examine network layer headers) switches: L2/link layer devices Routers: maintain forwarding tables implement routing protocols forward IP packets based on forwarding table entries & destination IP address Switches: maintain switching tables implement filtering, learning algorithms may implement spanning tree algorithm switch L2 frames based on switching table entries & destination MAC address Chapter 3: Internet Protocol v4 Routing 3-42

Routing Network prefix and host number L3/IP service goal: forward IP datagrams to destination IP subnet/host/interface IP address has role of locator & identifier: network part (network identifier & locator) host part (host identifier) Each IP network (often called subnetwork or subnet) has an IP address: IP address of a network = Host number is set to all zeros, e.g., 128.143.0.0 IP routers are devices that forward IP datagrams between IP networks Delivery of an IP datagram proceeds in 2 steps: 1. Use network prefix to deliver IP datagram to the right network 2. Once the network is reached, use the host L3 address to deliver to the right interface Chapter 3: Internet Protocol v4 Routing 3-43

Routing Forwarding and routing Forwarding: data plane Directing a data packet to an outgoing link Individual router using a forwarding table Routing: control plane Computing the paths the packets will follow Individual router creating a forwarding table Routing protocols (e.g., RIP, OSPF, BGP): Distributed routing protocol entities in routers talking amongst themselves Routing in Software Defined Networking (SDN): Router may receive forwarding and/or routing information via SDN control plane Control plane might not necessarily be inside the router Chapter 3: Internet Protocol v4 Routing 3-44

Routing IP router: functional components routing protocol messages routing functions routing protocol messages forwarding table updates Control Plane forwarding table incoming IP datagrams forwarding table lookups IP forwarding outgoing IP datagrams Data Plane: per-packet processing Chapter 3: Internet Protocol v4 Routing 3-45

Routing Routing and forwarding Routing functions include: route calculation execution of routing protocols maintenance of routing state maintenance of forwarding table On commercial routers handled by a single general purpose processor, called routing processor IP forwarding is per-packet processing On high-end commercial routers, IP forwarding is distributed (Most work is done on the interface cards) Chapter 3: Internet Protocol v4 Routing 3-46

Routing Router architecture Two key router functions run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link input port output port switching fabric input port output port routing processor Chapter 3: Internet Protocol v4 Routing 3-47

Routing Acknowledgements Jim Kurose, University of Massachusetts, Amherst Keith Ross, Polytechnic Institute of NYC Olivier Bonaventure, University of Liege Srinivasan Keshav, University of Waterloo Chapter 3: Internet Protocol v4 Routing 3-48

Chapter 3: Internet Protocol v4 Network layer Internet addressing ICMP ARP Routing Bibliography Chapter 3: Internet Protocol v4 3-49

Chapter 3: Internet Protocol v4 [1] DARPA. Internet Protocol. https://tools.ietf.org/html/rfc791. 1981. [2] J. Postel. Internet Control Message Protocol. https://tools.ietf.org/html/rfc792. 1981. [3] Philipp Richter et al. A primer on ipv4 scarcity. In: ACM SIGCOMM Computer Communication Review 45.2 (2015), pp. 21 31. Chapter 3: Internet Protocol v4 3-50