Announcements. IP Forwarding & Transport Protocols. Goals of Today s Lecture. Are 32-bit Addresses Enough? Summary of IP Addressing.

Similar documents
EE 122: IP Forwarding and Transport Protocols

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

CS457 Transport Protocols. CS 457 Fall 2014

UNIT IV -- TRANSPORT LAYER

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

The Transmission Control Protocol (TCP)

IP Addressing & Forwarding

TCP Service Model. Announcements. TCP: Reliable, In-Order Delivery. Today s Lecture. TCP Support for Reliable Delivery. TCP Header

Announcements. IP Addressing & Forwarding. Designing IP s Addresses. Goals of Today s Lecture. Grouping Related Hosts. IP Addresses (IPv4)

Network Performance: Queuing

TCP Performance. EE 122: Intro to Communication Networks. Fall 2006 (MW 4-5:30 in Donner 155) Vern Paxson TAs: Dilip Antony Joseph and Sukun Kim

Page 1. CS162 Operating Systems and Systems Programming Lecture 22. Networking III. Automatic Repeat Request

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Goal of Today s Lecture. EE 122: Designing IP. The Internet Hourglass. Our Story So Far (Context) Our Story So Far (Context), Con t

Page 1. Goals for Today" Discussion" Example: Reliable File Transfer" CS162 Operating Systems and Systems Programming Lecture 11

EE 122: Introduction To Communication Networks. Some Questions & Answers

CS 4390 Computer Networks. Transport Services and Protocols

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

Multiple unconnected networks

TCP Service Model. Today s Lecture. TCP Support for Reliable Delivery. EE 122:TCP, Connection Setup, Reliability

Communication Networks

Communication Networks

Goals for Today s Class. EE 122: Networks & Protocols. What Global (non-digital) Communication Network Do You Use Every Day?

CMPE 80N: Introduction to Networking and the Internet

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Communication Networks

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Different Layers Lecture 20

CS4700/CS5700 Fundamentals of Computer Networks

Vorlesung Kommunikationsnetze

Networks Fall This exam consists of 10 problems on the following 13 pages.

Lecture 9: Transpor Layer Overview and UDP

Lecture 16: Network Layer Overview, Internet Protocol

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

CSEN 503 Introduction to Communication Networks. Mervat AbuElkheir Hana Medhat Ayman Dayf. ** Slides are attributed to J. F.

CS 421: COMPUTER NETWORKS SPRING FINAL May 24, minutes. Name: Student No: TOT

Network Performance: Queuing

Lecture 5. Transport Layer. Transport Layer 1-1

COSC4377. Useful Linux Tool: screen

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Announcements Computer Networking. What was hard. Midterm. Lecture 16 Transport Protocols. Avg: 62 Med: 67 STD: 13.

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

The Transport Layer Multiplexing, Error Detection, & UDP

Ethernet. EE 122: Intro to Communication Networks. Fall 2007 (WF 4-5:30 in Cory 277) Vern Paxson TAs: Lisa Fowler, Daniel Killebrew & Jorge Ortiz

Question. Reliable Transport: The Prequel. Don t parse my words too carefully. Don t be intimidated. Decisions and Their Principles.

CS 43: Computer Networks Switches and LANs. Kevin Webb Swarthmore College December 5, 2017

Chapter 3: Transport Layer Part A

Communication Networks

CS164 Final Exam Winter 2013

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

Guide To TCP/IP, Second Edition UDP Header Source Port Number (16 bits) IP HEADER Protocol Field = 17 Destination Port Number (16 bit) 15 16

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

Computer Communication Networks Midterm Review

Network Protocols - Revision

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

Announcements. Designing IP. Our Story So Far (Context) Goals of Today s Lecture. Our Story So Far (Context), Con t. The Internet Hourglass

ECE697AA Lecture 3. Today s lecture

Suprakash Datta. Office: CSEB 3043 Phone: ext Course page:

CMPE150 Midterm Solutions

MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E

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

PLEASE READ CAREFULLY BEFORE YOU START

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

Transport Layer. Chapter 3: Transport Layer

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

TCP: Flow and Error Control

CS 421: COMPUTER NETWORKS SPRING FINAL May 16, minutes

User Datagram Protocol (UDP):

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

Chapter 6. What happens at the Transport Layer? Services provided Transport protocols UDP TCP Flow control Congestion control

Introduction to Internetworking

precise rules that govern communication between two parties TCP/IP: the basic Internet protocols IP: Internet protocol (bottom level)

Chapter 3: Transport Layer

Da t e: August 2 0 th a t 9: :00 SOLUTIONS

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Page 1. Review: Internet Protocol Stack. Transport Layer Services EEC173B/ECS152C. Review: TCP. Transport Layer: Connectionless Service

c) With the selective repeat protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.

Introduction to Networks and the Internet

CS 5520/ECE 5590NA: Network Architecture I Spring Lecture 13: UDP and TCP

Connectionless and Connection-Oriented Protocols OSI Layer 4 Common feature: Multiplexing Using. The Transmission Control Protocol (TCP)

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

EE 122: Transport Protocols: UDP and TCP

Page 1. Review: Internet Protocol Stack. Transport Layer Services. Design Issue EEC173B/ECS152C. Review: TCP

COMP/ELEC 429/556 Introduction to Computer Networks

CSCI-GA Operating Systems. Networking. Hubertus Franke

Routers. Session 12 INST 346 Technologies, Infrastructure and Architecture

CNBK Communications and Networks Lab Book: Purpose of Hardware and Protocols Associated with Networking Computer Systems

Flow and Congestion Control

Internet and Intranet Protocols and Applications

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

CMSC 332 Computer Networks Transport Layer

Networking and Internetworking 1

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

TDTS06: Computer Networks

Agenda. Forwarding (after a little more addressing) Follow-up from last time. Dealing with Address Scarcity. Sharing a Block of Addresses

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

Transcription:

IP Forwarding & Transport Protocols EE 122: Intro to Communication Networks Fall 2007 (WF 4-5:30 in Cory 277) Vern Paxson TAs: Lisa Fowler, Daniel Killebrew & Jorge Ortiz http://inst.eecs.berkeley.edu/~ee122/ Announcements Some of the Tuesday section students would prefer to keep it open Does it work to instead close the Monday section? Let us know Please take the poll (see the announcements page) regarding lecture scheduling for Thanksgiving week Homework #1 due next Friday before lecture Materials with thanks to Jennifer Rexford, Ion Stoica, and colleagues at Princeton and UC Berkeley 1 2 Goals of Today s Lecture Summary of IP addressing structure How IP packet forwarding works Principles underlying transport-layer services Service models (UDP vs. ) (De)multiplexing via port numbers Reliable delivery Performance issues: o Stop-and-Wait vs. Sliding Window o Flow control Non-goal: details of s operations 3 Are 32-bit Addresses Enough? Not all that many unique addresses 2 32 = 4,294,967,296 (just over four billion) Plus, some (many) reserved for special purposes And, addresses are allocated in larger blocks And, many devices need IP addresses Computers, PDAs, routers, tanks, toasters, Long-term solution (perhaps): larger address space IPv6 has 12 addresses (2 128 = 3.403 10 38 ) Short-term solutions: limping along with IPv4 Private addresses ( Net 10, etc.) + Network address translation (NAT) Dynamically-assigned addresses (DHCP) 4 Summary of IP Addressing 32-bit numbers identify interfaces Allocated in es Non-uniform hierarchy for scalability and flexibility Routing is based on CIDR A number of special-purpose blocks reserved Address allocation: ICANN RIR ISP customer host Issues to be covered later How hosts get their addresses (DHCP) How to map from an IP address to a link address (ARP) 6 5 Packet Forwarding 1

Hop-by-Hop Packet Forwarding Each router has a forwarding table Maps addresses to outgoing interfaces (= links) Upon receiving a packet Inspect the IP address in the header Index into the table Find the longest match Forward packet out interface associated with match Where does forwarding table come from? Routing algorithms (or static configs) 7 8 192: 11000000 9 4: 00000100 83: 01010011 128: 10000000 10 11 12 2

Simple Algorithms Are Too Slow Algorithmic problem: how do we do this fast? 13 Scan the forwarding table one entry at a time See if the matches the entry If so, check the size of the mask for the Keep track of the entry with longest-matching Overhead is linear in size of the forwarding table Today, that means 150,000-200,000 entries! And, the router may have just a few nanoseconds before the next packet arrives Need greater efficiency to keep up with line rate Better algorithms Hardware implementations 14 Patricia Tree Store the es as a tree One bit for each level of the tree Some nodes correspond to valid es (w/ next-hop interfaces) When a packet arrives Traverse the tree based on the address Stop upon reaching the longest matching Running time: scales with # bits in address (but takes more memory) Lot of work on still-faster algorithms 0 1 How Does Sending End Host Forward? No need to run a routing protocol Packets to the host itself (e.g., 1.2.3.4/32) o Delivered locally Packets to other hosts on the LAN (e.g., 1.2.3.0/25) o Sent out the interface with LAN address (ARP) o Can tell they re local using subnet mask (e.g., 255.255.255.128) Packets to external hosts (any others) o Sent out interface to local gateway o I.e., IP router on the LAN 00 10 11 0* 00* 100 101 How this information is learned Static setting of address, subnet mask, and gateway Or: Dynamic Host Configuration Protocol (DHCP) 11* 15 16 What About Reaching the End Hosts? How does the last router reach the? 1.2.3.4 1.2.3.7 1.2.3.156 host host... host LAN router Each interface has a persistent, global identifier MAC address (Media Access Control) - Layer 2 Programmed into NIC Usually flat address structure (i.e., no hierarchy) Constructing an address resolution table Mapping MAC address to/from IP address Address Resolution Protocol (ARP) 17 Role of Transport Layer Application layer Communication for specific applications E.g., HyperText Transfer Protocol (HTTP), File Transfer Protocol (FTP), Network News Transfer Protocol (NNTP) Transport layer Communication between processes (e.g., socket) Relies on layer; serves the application layer E.g., and UDP Network layer Logical communication between nodes Hides details of the link technology E.g., IP 18 3

Transport Protocols Internet Transport Protocols Provide logical communication between application processes running on different hosts application transport Run on end hosts Sender: breaks application messages into segments, and passes to layer Receiver: reassembles segments into messages, passes to application layer Multiple transport protocol available to applications Internet: and UDP (mainly) logical end-end transport application transport 19 Datagram messaging service (UDP) No-frills extension of best-effort IP Reliable, in-order delivery () Connection set-up & tear-down Discarding of corrupted packets Retransmission of lost packets Flow control Congestion control Services not available Delay guarantees Bandwidth guarantees Sessions that survive change-of-ip-address 20 4-bit Version 4-bit Header Length 4-bit Version 4-bit Header Length Protocol Protocol Options (if any) Options (if any) 4 5 4 5 Protocol 6 = 17 = UDP 4

4 5 6 = 17 = UDP 16-bit Source Port More transport header fields. 16-bit Destination Port Multiplexing and Demultiplexing Host receives IP datagrams Each datagram has source and IP address, Each datagram carries one transport-layer segment Each segment has source and port number Host uses IP addresses and port numbers to direct the segment to appropriate socket 32 bits source port # dest port # other header fields application data (message) /UDP segment format 26 Unreliable Message Delivery Service Lightweight communication between processes Avoid overhead and delays of ordered, reliable delivery Send messages to and receive them from a socket User Datagram Protocol (UDP; RFC 768-1980!) IP plus port numbers to support (de)multiplexing Optional error checking on the packet contents o (checksum field = 0 means don t verify checksum ) SRC port DST port checksum DATA length 27 Why Would Anyone Use UDP? Finer control over what data is sent and when As soon as an application process writes into the socket UDP will package the data and send the packet No delay for connection establishment UDP just blasts away without any formal preliminaries which avoids introducing any unnecessary delays No connection state No allocation of buffers, sequence #s, timers making it easier to handle many active clients at once Small packet header overhead UDP header is only 8 bytes 28 Popular Applications That Use UDP Multimedia streaming Retransmitting lost/corrupted packets often pointless - by the time the packet is retransmitted, it s too late E.g., telephone calls, video conferencing, gaming Simple query protocols like Domain Name System Connection establishment overhead would double cost Easier to have application retransmit if needed Address for bbc.co.uk? 5 Minute Break Questions Before We Proceed? 212.58.224.131 29 30 5

Transmission Control Protocol () Connection oriented Explicit set-up and tear-down of session Stream-of-bytes service Sends and receives a stream of bytes, not messages Congestion control Dynamic adaptation to path s capacity Reliable, in-order delivery tries very hard to ensure byte stream (eventually) arrives intact o In the presence of corruption and loss Flow control Reliable Delivery How do we design for reliable delivery? One possible model: how does it work talking on your cell phone? Positive acknowledgment ( Ack ) Explicit confirmation by receiver acknowledgments are cumulative ( I ve received everything up through sequence #N ) o With an option for acknowledging individual segments ( SACK ) Negative acknowledgment ( Nack ) I m missing the following: How might the receiver tell something s missing? Can they always do this? (Only used by in implicit fashion - fast retransmit ) Ensure that sender doesn t overwhelm receiver 31 32 Reliable Delivery, con t Timeout If haven t heard anything from receiver, send again Problem: for how long do you wait? o uses function of estimated RTT Problem: what if no Ack for retransmission? o (and other schemes) employs exponential backoff o Double timer up to maximum - tapers off load during congestion A very different approach to reliability: send redundant data Cell phone analogy: Meet me at 3PM - repeat 3PM Forward error correction Recovers from lost data nearly immediately! But: only can cope with a limited degree of loss And: adds load to the 33 Support for Reliable Delivery Sequence numbers Used to detect missing data... and for putting the data back in order Checksum Used to detect corrupted data at the receiver leading the receiver to drop the packet No error signal sent - recovery via normal retransmission Retransmission Sender retransmits lost or corrupted data Timeout based on estimates of round-trip time (RTT) Fast retransmit algorithm for rapid retransmission 34 Automatic Repeat request (ARQ) Efficient Transport Reliability Automatic Repeat Request Receiver sends acknowledgment (ACK) when it receives packet Sender waits for ACK and times out if does not arrive within some time period Simplest ARQ protocol Stop and Wait Send a packet, stop and wait until ACK arrives Time Sender Receiver Timeout Packet ACK 35 36 6

How Fast Can Stop-and-Wait Go? Suppose we re sending from UCB to New York: Bandwidth = 1 Mbps (megabits/sec) RTT = 100 msec Maximum Transmission Unit (MTU) = 1500 B = 12,000 b No other load on the path and no packet loss What (approximately) is the fastest we can transmit using Stop-and-Wait? How about if Bandwidth = 1 Gbps? Allowing Multiple Packets in Flight In Flight = Unacknowledged Sender-side issue: how many packets (bytes)? Receiver-side issue: how much buffer for data that s above a sequence hole? I.e., data that can t be delivered since previous data is missing Assumes service model is in-order delivery (like ) 37 38 Sliding Window Allow a larger amount of data in flight Allow sender to get ahead of the receiver though not too far ahead Sending process Last byte written Last byte ACKed Receiving process Next byte needed Sender Window Last byte read Sliding Window, con t Both sender & receiver maintain a window that governs amount of data in flight (sender) or notyet-delivered (receiver) Left edge of window: Sender: beginning of unacknowledged data Receiver: beginning of undelivered data For the sender: Window size = maximum amount of data in flight o Determines rate o Sender must have at least this much buffer (maybe more) For the receiver: Window size = maximum amount of undelivered data Receiver Window Last byte received Last byte can send 39 o Receiver has this much buffer 40 Sliding Window For the sender, when receives an acknowledgment for new data, window advances (slides forward) Sliding Window For the sender, when receives an acknowledgment for new data, window advances (slides forward) Sending process Sending process Last byte written Last byte written Last byte ACKed Sender Window Last byte ACKed Sender Window Last byte can send 41 Last byte can send 42 7

Sliding Window For the receiver, as the receiving process consumes data, the window slides forward Sliding Window For the receiver, as the receiving process consumes data, the window slides forward Receiving process Receiving process Last byte read Last byte read Next byte needed Next byte needed Receiver Window Last byte received 43 Receiver Window Last byte received 44 Sliding Window, con t Sender: window advances when new data ack d Receiver: window advances as receiving process consumes data What happens if sender s window size exceeds the receiver s window size? Receiver advertises to the sender where the receiver window currently ends ( righthand edge ) Sender agrees not to exceed this amount It makes sure by setting its own window size to a value that can t send beyond the receiver s righthand edge 45 Performance with Sliding Window Given previous UCB New York 1 Mbps path with 100 msec RTT and Sender (and Receiver) window = 100 Kb = 12.5 KB How fast can we transmit? What about with 12.5 KB window & 1 Gbps path? Window required to fully utilize path: Bandwidth-delay product (or delay-bandwidth product ) 1 Gbps * 100 msec = 100 Mb = 12.5 MB Note: large window = many packets in flight 46 Summary IP packet forwarding Based on longest- match End systems use subnet mask to determine if traffic destined for their LAN o In which case they send directly, using ARP to find MAC address or for some other o In which case they send to their local gateway (router) This info either statically config d or learned via DHCP Transport protocols Multiplexing and demultiplexing via port numbers UDP gives simple datagram service gives reliable byte-stream service Reliability immediately raises performance issues o Stop-and-Wait vs. Sliding Window 47 Next Lecture DNS = Domain Name System Reading: K&R 2.5 Homework #1 due next Friday before class Reminder: we re now considering closing the Monday section instead of Tuesday 48 8