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

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

CS 3516: Advanced Computer Networks

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

CS 3516: Computer Networks

Network Layer PREPARED BY AHMED ABDEL-RAOUF

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

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

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

CSCI Computer Networks Fall 2016

Network layer: Overview. Network Layer Functions

internet technologies and standards

internet technologies and standards

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

Chapter 4 Network Layer

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

Chapter 4 Network Layer

Router Architecture Overview

COMP211 Chapter 4 Network Layer: The Data Plane

Chapter 4: network layer

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

Master Course Computer Networks IN2097

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

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

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

Chapter 4 Network Layer: The Data Plane

CSC 401 Data and Computer Communications Networks

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

Network Layer: Control/data plane, addressing, routers

Basic Internetworking (IP)

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

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

CSC 4900 Computer Networks: Network Layer

CSCE 463/612 Networks and Distributed Processing Spring 2018

Network Layer: Internet Protocol

TDTS06: computer Networks

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

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

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer

Chapter 4 Network Layer: The Data Plane

Computer Networking Introduction

Chapter 4 Network Layer

HW3 and Quiz. P14, P24, P26, P27, P28, P31, P37, P43, P46, P55, due at 3:00pm with both soft and hard copies, 11/11/2013 (Monday) TCP), 20 mins

Networking Potpourri: Plug-n-Play, Next Gen

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

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

CMPE 80N: Introduction to Networking and the Internet

Internetworking Part 2

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer: The Data Plane

IPv4. Christian Grothoff.

Course on Computer Communication and Networks. Lecture 6 Network Layer part 1: Data Plane Chapter 4 (7/e) (6/e Ch4-first part)

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

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

CSCD 330 Network Programming Spring 2018

Information Network Systems The network layer. Stephan Sigg

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

Internet Protocol (IP)

Internet Technology 3/23/2016

CSCD 330 Network Programming Spring 2017

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

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

Introduction to Internetworking

The Network Layer Forwarding Tables and Switching Fabric

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

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

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

ECE 4450:427/527 - Computer Networks Spring 2017

Network layer Network Layer 4-1

Chapter 4 Network Layer

Lecture 16: Network Layer Overview, Internet Protocol

TSIN02 - Internetworking

CS118 Discussion, Week 6. Taqi

COSC4377. TCP vs UDP Example Statistics

Chapter 4 Network Layer

CSC 401 Data and Computer Communications Networks

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

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

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

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer: The Data Plane

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

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

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

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

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

IP - The Internet Protocol

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

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

Chapter 4 Network Layer: The Data Plane

Network Layer: Data Plane 4-2

Lecture 3: Packet Forwarding

End-to-End Communication

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

Internetworking Part 2

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Chapter 4: Network Layer

Network Protocols - Revision

Transcription:

IPv4 addressing, NAT http://xkcd.com/195/ Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Some materials copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights Reserved

Chapter 4: outline 4.1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What's inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing Network Address Translation (NAT) DHCP ICMP IPv6 IPsec 4.5 Routing algorithms Link state Distance vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing 2

IP 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 How much overhead? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead ver head. len 16-bit identifier time to live type of service upper layer 32 bits flgs length 32 bit source IP address data (variable length, typically a TCP or UDP segment) fragment offset header checksum 32 bit destination IP address options (if any) Total datagram length (bytes) For fragmentation/ reassembly e.g. timestamp, record route taken, specify list of routers to visit. 3

Fragmentation Different networks support different packet sizes Maximum Transmission Unit (MTU) e.g. Ethernet 1500 bytes, 802.11 2272 bytes Occurs at router If inbound datagram > MTU of outbound network Split into fragments All fragments have same Ident field Each is self-contained datagram 4

Fragmentation and reassembly Reassembly can be done independent of order of arrival Fragments may also be fragmented No attempt to recover if fragment missing Hosts can do MTU discovery Probe message to determine max packet size 5

IP service model Global addressing Assumes global addresses Why not 48-bit MAC address? flat structure, no hierarchy e.g. 01:23:45:67:89:ab IP addresses IPv4 32 bits network part host part e.g. 10.33.73.165 6

IPv4 address format Classful addressing (before 1993): Class A: 128 networks with 16 million hosts Class B: 16,384 networks with 65,536 hosts Class C: 2 million networks, 256 hosts 7

Special IP addresses Dot notation, each byte converted to decimal 1000 0000 1101 0000 0000 0010 1001 0111 128.208.2.151 8

IP datagram forwarding Why (network + host) address help? Routers have a forwarding table Network number -> next hop Without hierarchy: Tables in routers would be huge Machines on same network wouldn't know it Default router Where to send things if not in your table 9

Routing example Message H1 -> H2 H5 -> H8 What happens H1 deduces on same network as H2 Sends Ethernet packet directly H5 deduces H8 not on same network H5 sends message to default router R1 R1 can't delivery directly, send to its default router R2 R2 has a forwarding table showing H8 available from R3, sends to R3 R3 delivery to network 4. 10

The three bears problem For most organizations: Class A network too big Class C network too small Class B network... just right Actually class B too large for most Half of all class B holders had 50 or fewer hosts 16,384 class B not enough for widespread popularity of the interpipes 11

Classless addressing Classless Interdomain Routing (CIDR) We want: Efficient address allocation Small and fast forwarding tables Compromise: Aggregate contiguous blocks of IP addresses /X notation Specify how many prefix bits are network number 12

CIDR examples 13

IP forwarding with CIDR CIDR prefixes 2-32 bits May have overlapping prefixes in forwarding table Example: Forwarding table: 171.69 (16-bit prefix) Forwarding table: 171.69.10 (24-bit) Destination: 171.69.10.5, matches both Router uses longest match 14

Private IP addresses Private networks (home networks, etc.) Use specified part of IP address space Not globally routable http://xkcd.com/742/ 15

Jan 31, 2011 IPv4 address exhaustion Last unreserved IANA /8 blocks allocated 5 remaining blocks allocated to each of 5 Regional Internet registries (RIR) http://www.youtube.com/watch?v=y8wqjum_gfg 16

NAT Network address translation (NAT) Quick fix to address scarcity Home/business gets one public IP Private IP addresses for all hosts inside network NAT box translates at boundary to public IP 17

NAT design Problem: Where to route reply from remote server? NAT designers observed: Most IP traffic over TCP/UDP TCP/UDP have a 16-bit integer port # Source port and destination port (e.g. 80 for web) Solution: Use source port as an index into a translation table 18

NAT translation Map outgoing packets Replace src addr NAT box addr (public IP) Replace src port # new port # Maintain a translation table (src addr, port #) (NAT addr, new port #) Free up entry after timeout (frees up port #) Incoming packets Consult translation table Rewrite packet and send to local host 19

NAT example 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 20

Where is NAT implemented? Home router Integrates router, DHCP server, NAT, firewall, etc. Single IP address on WAN side from service provider Campus or corporate network NAT box at Internet connection point Share a collection of public IP addresses Allows many hosts inside network 21

NAT advantages Helps converse IPv4 addresses Easy to switch Internet providers All your devices are using private IPs via DHCP Provides a measure of security Outside computers cannot initiate connections However, doesn't protect against: Connections initiated from behind the NAT box to bad places Attacks from hosts inside network 22

NAT an abomination? 1) Violates the IP model Every host should have unique identifier 2) Breaks end-to-end connectivity model Any host should be able to send a packet to any other host at any time 3) Not connectionless NAT box has state, effectively circuit switching Single point of failure 4) Network layers are not independent NAT looks into the payload 23

NAT an abomination? 5) Forces use of TCP/UDP protocols Anything else, NAT fails to find TCP Source port 6) Breaks if multiple TCP/IP or UDP ports e.g. FTP and H.323 Internet telephony 7) Limited number of hosts on NAT box Only 16-bits in TCP Source port Can't have > 64K machines on a single IP 24

NAT traversal Make connections through NAT boxes Client-to-client apps: Voice over IP, video conference, file sharing, gaming One option: UDP hole punching Goal: establish UDP connection between clients Approach: Use central server with public IP to coordinate. Establish direct UDP connections between clients. 25

UDP hole punching Skype server 3.3.3.3 Skype server 3.3.3.3 1.1.1.1 2.2.2.2 1.1.1.1 1234 2.2.2.2 5678 Alice Bob 1. Permanent TCP connections to public central server. Alice Bob 2. Tests reveals UDP port Alice and Bob use to send voice data. 26

UDP hole punching Skype server 3.3.3.3 Skype server 3.3.3.3 1.1.1.1 1234 2.2.2.2 5678 1.1.1.1 1234 2.2.2.2 5678 Alice Bob 3. Bob sends Alice UDP packet on port 1234. Alice's firewall drops. Alice Bob 4. Alice sends Bob UDP packet on port 5678. Bob's firewall thinks it is a response to his blocked initial packet. 27

NAT traversal Make connections through NAT boxes Another option: Universal Plug and Play (UPnP) Internet Gateway Device (IGD) protocol Allows NAT'd hosts to: Learn public IP address of WAN side of NAT box Add/remove port mappings (with lease times) Enumerate existing port mappings IGD 10.0.0.1 NAT router 28

Internet Protocol fragmentation Split at router if IP packet too big for link-layer IP addressing Summary Global hierarchical name IPv4, original version, 2 32 addresses CIDR address, specifies range of IP space Network Address Translation (NAT) Helps conserve IPv4 addresses Provides some measure of security UPnP, allows host to configure NAT 29