EEC-682/782 Computer Networks I

Similar documents
EEC-484/584 Computer Networks

EEC-484/584 Computer Networks. Lecture 16. Wenbing Zhao

EEC-682/782 Computer Networks I

EEC-684/584 Computer Networks

Jaringan Komputer. The Transport Layer

Lecture 20 Overview. Last Lecture. This Lecture. Next Lecture. Transport Control Protocol (1) Transport Control Protocol (2) Source: chapters 23, 24

Upper Layer Services. Berkeley Sockets Example of Socket Programming: Internet File Server

The OSI Reference Model. EECC694 - Shaaban

Chapter 6. The Transport Layer. The Transport Service. Services Provided to the Upper Layers. Transport Service Primitives (3) 10/7/2010

Telecommunication Protocols Laboratory Course. Lecture 3

THE TRANSPORT LAYER UNIT IV

Elements of Transport Protocols

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

User Datagram Protocol

COMPUTER NETWORKS - UNIT 4 Y3/S5

EEC-484/584 Computer Networks

6.2 Elements of Transport Protocols

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

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

EEC-484/584 Computer Networks

Chapter 12 Network Protocols

CSE 461 The Transport Layer

Transport Layer Chapter 6

Different Layers Lecture 20

The Transport Layer. Why is there a transport layer? Addressing

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

Applied Networks & Security

Chapter 09 Network Protocols

QUIZ: Longest Matching Prefix

CSE 461 Connections. David Wetherall

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 25, 2018

CMPE 150 Winter 2009

UNIT IV -- TRANSPORT LAYER

Outline EEC-682/782 Computer Networks I. Midterm 1 Statistics. Midterm 1 Statistics. High 99, Low 34, Average 66

Topics for This Week

6.2 Elements of Transport Protocols

CSEP 561 Connections. David Wetherall

Transport Layer (TCP/UDP)

ECE 650 Systems Programming & Engineering. Spring 2018

by Douglas Comer, Purdue University

Transport Protocols & TCP TCP

TCPIP Protocol Suite & Utilities. Revision no.: PPT/2K403/02

Data Link Control Protocols

Introduction to Networks and the Internet

Finish Network Layer Start Transport Layer. CS158a Chris Pollett Apr 25, 2007.

CSC 634: Networks Programming

The Interconnection Structure of. The Internet. EECC694 - Shaaban

CS 716: Introduction to communication networks th class; 7 th Oct Instructor: Sridhar Iyer IIT Bombay

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

Network Protocols. Sarah Diesburg Operating Systems CS 3430

TSIN02 - Internetworking

Lecture 11: IP routing, IP protocols

Introduction to Internetworking

Computer Networks. Routing

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

NT1210 Introduction to Networking. Unit 10

Outline. EEC-484/584 Computer Networks. Data Link Layer Design Issues. Framing. Lecture 6. Wenbing Zhao Review.

Transport Protocols and TCP: Review

19: Networking. Networking Hardware. Mark Handley

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS

Internetworking. different kinds of network technologies that can be interconnected by routers and other networking devices to create an internetwork

TSIN02 - Internetworking

Computer Network Programming. The Transport Layer. Dr. Sam Hsu Computer Science & Engineering Florida Atlantic University

CSEP 561 Connections. David Wetherall

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

The Transport Layer. The need for the transport layer

II. Principles of Computer Communications Network and Transport Layer

Internetworking Part 2

Chapter 22 Network Layer: Delivery, Forwarding, and Routing 22.1

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

TCP/IP Performance ITL

Outline. Connecting to the access network: DHCP and mobile IP, LTE. Transport layer: UDP and TCP

Outline. CS5984 Mobile Computing

Operating Systems and Networks. Network Lecture 8: Transport Layer. Adrian Perrig Network Security Group ETH Zürich

Operating Systems and Networks. Network Lecture 8: Transport Layer. Where we are in the Course. Recall. Transport Layer Services.

What is the difference between unicast and multicast? (P# 114)

Chapter 5 (Week 10) The Network Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP

CS4700/CS5700 Fundamentals of Computer Networks

Networking: Network layer

1.What are the services provided by the transport layer to the upper layers?

ADVANCED COMPUTER NETWORKS

TCP over wireless links

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

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

23-3 TCP. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control 23.22

Networking for Data Acquisition Systems. Fabrice Le Goff - 14/02/ ISOTDAQ

Module 25 TCP Timers and delayed duplicates problem in TCP

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

TCP/IP Protocol Suite and IP Addressing

TSIN02 - Internetworking

06/02/ Local & Metropolitan Area Networks 0. INTRODUCTION. 1. History and Future of TCP/IP ACOE322

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

This Lecture. BUS Computer Facilities Network Management. Switching Network. Simple Switching Network

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

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

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

Switching & ARP Week 3

CS 356: Computer Network Architectures. Lecture 14: Switching hardware, IP auxiliary functions, and midterm review. [PD] chapter 3.4.1, 3.2.

Chapter 6. The Network Layer

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

Transcription:

EEC-682/782 Computer Networks I Lecture 15 Wenbing Zhao w.zhao1@csuohio.edu http://academic.csuohio.edu/zhao_w/teaching/eec682.htm (Lecture nodes are based on materials supplied by Dr. Louise Moser at UCSB and Prentice-Hall) Outline Review of last lecture The network layer in Internet The transport layer Transport service Elements of transport protocols -Wenbing Zhao 2 1

Review Essential topics of last lecture NAT ICMP, ARP, RARP, BOOTP, DHCP OSPF, BGP -Wenbing Zhao 3 NAT Network Address Translation Placement and operation of a NAT box. -Wenbing Zhao 4 2

Internet Control Message Protocol ICMP Internet Control Message Protocol When something unexpected occurs in Internet, the event is reported by routers using ICMP It is also used to test Internet Principal ICMP message types -Wenbing Zhao 5 ARP and RARP 32-bit Internet address ARP RARP 48-bit Ethernet address ARP find the mapping of IP addresses to data link layer addresses RARP - This protocol allows a newly-booted diskless-workstation (e.g., X terminal) to broadcast its Ethernet address and ask for its IP address RARP server responds to a RARP request with the assigned IP address -Wenbing Zhao 6 3

BOOTP Bootstrap Protocol Limitations of RARP RARP uses a link-layer broadcast, RARP requests are not forwarded by routers, therefore, an RARP server must be present on every network. The only thing returned by the RARP server is the IP address BOOTP uses UDP When a client is bootstrapping using BOOTP, the request is normally a link-layer broadcast and the destination IP address in the IP header is normally 255.255.255.255 The source IP address is set to 0.0.0.0 if client does not know its own IP address yet Recall that 0.0.0.0 is a valid source IP address when a system is bootstrapping itself Port number: 67 for server, 68 for client -Wenbing Zhao 7 DHCP - Dynamic Host Configuration Protocol BOOTP drawbacks Requires manual configuration of tables mapping IP address to Ethernet address at the BOOTP server DHCP Allows both manual IP address assignment and automatic assignment. DHCP has largely replaced RARP and BOOTP A DHCP relay agent is needed on each LAN. The only piece of information the relay agent needs is the IP address of the DHCP server. To find its IP address, a newly-booted machine broadcasts a DHCP DISCOVER packet. The DHCP relay agent on its LAN receives all DHCP broadcasts. When it finds a DHCP DISCOVER packet, it sends the packet as a unicast packet to the DHCP server, possibly on a distant network IP address assignment is lease-based (to cope with client failure) -Wenbing Zhao 8 4

Internet Routing Protocols -Wenbing Zhao 9 OSPF Within area, each router has same link state database Each router periodically floods LINK STATE UPDATE packets to each of its adjacent routers Each router constructs the graph for its area and computes shortest path Backbone router also does: Accepts info from area border routers Computes best route from each area border router to every other area border router This info propagated back to area border routers which advertise it within their areas Using this info, router about to send interarea packet selects best exit router to backbone -Wenbing Zhao 10 5

The Exterior Gateway Routing Protocol Border Gateway Protocol (BGP) Used between autonomous systems Main concerns: politics, security, economic Uses distance vector routing except keeps track of exact path instead of cost to destination and periodically tells its neighbors that path -Wenbing Zhao 11 Transport Layer Goals: To provide efficient, reliable, cost-effective service to the transport layer users To allow application programs to be written using a standard set of primitives and to have programs work on a variety of networks To enhance the quality of service provided by the network layer below it -Wenbing Zhao 12 6

Services Provided to the Upper Layers Transport Entity - The hardware and/or software within the transport layer that does the work. The transport entity can be located in Operating system kernel, a separate user process, a library package bound into network applications, or conceivably on the network interface card TPDU: Transport Protocol Data Unit Services Provided to the Upper Layers The transport layer fulfills the key function of isolating the upper layers from the technology, design, and imperfections of the subnet For this reason, many people have traditionally made a distinction between layers 1 through 4 on the one hand and layer(s) above 4 on the other: Transport service provider -The bottom four layers Transport service user - the upper layer(s) -Wenbing Zhao 14 7

Transport Service Primitives Connection oriented Provides reliable service on top of unreliable network -Wenbing Zhao 15 Transport Service Primitives The nesting of TPDUs, packets, and frames. -Wenbing Zhao 16 8

Transport Service Primitives A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence. Berkeley Sockets Socket an endpoint to which connections can be attached from bottom (OS) and to which processes can be established from top Socket primitives for TCP -Wenbing Zhao 18 9

Berkeley Sockets Socket: Creates a new end point and allocates table space for it Parameters to call specify address format, socket type (e.g., reliable byte stream), protocol (typically TCP/IP) Bind: Each socket has name by which remote user can send connection request to socket Bind call attaches name to socket -Wenbing Zhao 19 Berkeley Sockets Listen: After a socket has been created, listen call allocates space to queue incoming calls in case several clients try to connect simultaneously Listen call is non-blocking Accept: Accept call is blocking, waits for incoming connection When TPDU requesting a connection arrives, new socket is created and file descriptor is returned for it Server can fork off process or thread to handle connection on new socket and wait for next connection on original socket -Wenbing Zhao 20 10

Berkeley Sockets Connect: Blocks the caller (default setting) and actively starts the connection process When it completes (appropriate TPDU is received from server), client is unblocked and connection is established Send Receive Close When both sides have executed Close, connection is released -Wenbing Zhao 21 Socket Programming Example Internet File Server Code available at http://www.prehall.com/tanenbaum Compilation flag in Linux is different from what s given in the textbook Setsockopt() on SO_REUSEADDR: This socket option tells the kernel that even if this port is busy (in the TIME_WAIT state), go ahead and reuse it anyway. If it is busy, but with another state, you will still get an address already in use error. It is useful if your server has been shut down, and then restarted right away while sockets are still active on its port. according to http://www.unixguide.net/network/socketfaq/4.5.shtml -Wenbing Zhao 22 11

Socket Programming Example: Internet File Server 6-6-1 Client code using sockets. Socket Programming Example: Internet File Server Client code using sockets 12

Transport Protocol The transport service is implemented by a transport protocol used between two transport entities Relationship with data link protocols Similarities: deal with error control, sequencing, flow control Difference: operating environments (a) Environment of the data link layer (b) Environment of the transport layer -Wenbing Zhao 25 Connection Management Addressing Connection establishment Connection release -Wenbing Zhao 26 13

Addressing Transport Service Access Points (TSAPs) to which processes can attach and wait for connections to arrive Addressing A Scenario A time of day server process on host 2 attaches itself to TSAP 1522 to wait for an incoming call An application process on host 1 wants to find out the timeof-day, so it issues a CONNECT request specifying TSAP 1208 as the source and TSAP 1522 as the destination. This action results in a transport connection being established between the application process on host 1 and server 1 on host 2. The application process then sends over a request for the time. The time server process responds with the current time The transport connection is then released. -Wenbing Zhao 28 14

Connection Establishment Internet Initial Connection Protocol Each machine has process server through which services are requested Idle process server listens on its TSAP User issues connection request specifying TSAP address of process server Once connection established, user sends message to process server asking it to run a particular program Process server chooses idle TSAP Spawns new process with that TSAP address Sends that TSAP address to user Terminates connection Returns to listen on its TSAP User releases connection to process server, connects to new process New process executes requested program, terminates when done Connection Establishment Internet Initial Connection Protocol 15

Connection Establishment Name Server (directory server) User sets up connection to Name Server, sends message specifying service name Name Server sends back TSAP address User releases connection with Name Server, establishes new connection with desired service When new service is created, it must register with Name Server giving its service name TSAP address -Wenbing Zhao 31 Connection Establishment Problem of Delayed Duplicates Possible Solutions When TSAP address is needed, new unique address is generated based on current time. When connection is released, address is discarded forever Each connection has unique identifier, chosen by initiator of connection put in each TPDU. When connection request arrives, checked against table. When connection released, each transport entity updates its table marking connection obsolete Both have drawbacks -Wenbing Zhao 32 16

Coping with Delayed Duplicates Sequence number based approach When start, set sequence number = time on processor s local clock If sequence number and time increase indefinitely, no problem of delayed duplicates Problem Memory is finite so sequence numbers and time stamps must wrap around, so delayed duplicates is a problem Memory is lost if processor crashes. If processor recovers, it can send message in its new life with same sequence number as in previous life -Wenbing Zhao 33 Coping with Delayed Duplicates Essential: ensure each packet has finite life using hop count or time stamp In practice, a packet s life time, T, is multiple of its true life time so that the all its acks are also dead If we wait a time T after a packet is sent, we can be sure that all traces of it are now gone Requiring T dead time after a crash might not be practical -Wenbing Zhao 34 17

Coping with Delayed Duplicates Solution Tomlinson s Algorithm Assumptions: Processors can crash Processors do not write sequence numbers to stable storage because it s inefficient Processor s clock keeps running if it crashes Processor s clock increases faster than sequence numbers Processor s clock and sequence numbers are recycled (wrapped around), but clock is recycled as least as often as sequence numbers, e.g., every 1000 years If processor does not crash, it knows its sequence numbers Messages have a lifetime (T), e.g., 60 seconds -Wenbing Zhao 35 Connection Establishment Good case: Send old message at time 20 with sequence number 90 Sender crashes; old message discarded at 20+60=80 Recover at time 90 Send new message at time 90 with sequence number 90 Sequence Number 90 Clock Die 60 Message discarded Recover 60 20 80 90 60 Real Time 18

Connection Establishment Bad case: Send old message at time 120 with sequence number 140 Sender crashes; recover at time 140 Send new message at time 140 with sequence number 140 Old message discarded at 120+60=180 Sequence Number Forbidden region 140 Clock Die Recover Message discarded 60 120 140 180 60 Real Time Connection Establishment When a transport entity gets into the forbidden region, problems arise A transport entity can enter the forbidden region From underneath by sending too fast From left sooner or later -Wenbing Zhao 38 19

Connection Establishment Tomlinson s Algorithm: When sequence number becomes equal to clock+time_to_live, set sequence number equal to clock Applicable only for data TPDU after a connection has been set up Sequence Number Forbidden Region Clock Message discarded 60 Sequence number adjusted Real Time Connection Establishment Three-way handshake to establish a connection, need to agree on initial sequence numbers (instead of using clock). Again, need to prevent delayed duplicates Host 1 chooses sequence number x, sends it to host 2 in a control TPDU Host 2 replies with a control TPDU, acks x, announces its own sequence number y Host 1 sends its first data TPDU, using x, acks y -Wenbing Zhao 40 20

Connection Establishment Three-way handshake (abnormal scenarios) -Wenbing Zhao 41 Connection Release Asymmetric release is abrupt and may result in data loss -Wenbing Zhao 42 21

Connection Release Symmetric release to avoid data loss, each side must wait to disconnect until it is sure that other side is prepared to disconnect It works when each process has a fixed amount of data to send and clearly knows when it has sent it Cannot guarantee no message loss otherwise two army problem Connection Release Two army problem the only way to win is if both blue armies attach. If only one attacks, it will be destroyed Blue armies communicate by messengers, but messengers can be caught, and their messages can be lost If no message loss, wait for message from each army, attack if none objects If message loss, impossible to decide whether or not to attack 22

Connection Release In practice, three-way handshake works most of the time Host 1 sends DR (Disconnect Request), starts timer in case DR lost Host 2 sends DC (Disconnect Confirm), starts timer in case DC lost When DC arrives, host 1 sends ACK, deletes connection When ACK arrives, host 2 deletes connection -Wenbing Zhao 45 Connection Release If host 1 s ACK is lost Host 2 s timer saves the day -Wenbing Zhao 46 23

Connection Release If DC or DR is lost Host 1 will not receive DC Host 1 s timer times out Host 1 starts over -Wenbing Zhao 47 Connection Release All repeated attempts to retransmit DR fail After n tries, host 1 gives up, deletes connection Host 2 times out, deletes connection -Wenbing Zhao 48 24

Connection Release Three-way handshake can fail if initial DR and n retransmissions are all lost Host 1 gives up, deletes connection Host 2 knows nothing about attempts to disconnect, remains fully active Result: half-open connection To kill off half-open connection, need timer Rule: if no TPDUs arrive in some number of seconds, disconnect connection -Wenbing Zhao 49 Flow Control and Buffering Like DLL, sliding window to prevent fast transmitter overwhelming slow receiver With unreliable network service, sender must buffer all TPDUs sent until they are acknowledged With reliable network service If receiver has plenty of buffer space, sender does not need to buffer TPDUs sent If receiver does not have enough buffer space, sender must buffer all TPDUs sent because ACK from the network layer only means the network layer at the other end received them -Wenbing Zhao 50 25

Flow Control and Buffering Organization of buffers Same size TPDUs use pool of equal size buffers with one TPDU per buffer Variable size IPDUs Buffer size = max TPDU size wasted space within buffers Buffer size < max TPDU size some TPDUs need several buffers Variable size buffers better buffer utilzation, but more complex management One large circular buffer per connection better buffer utilization Flow Control and Buffering Source buffering vs. destination buffering Low bandwidth bursty traffic Acquire buffers dynamically Sender must keep TPDU until its is acked Better to buffer at sender High bandwidth traffic Better to buffer at receiver Receiver should allocate full window of buffers to allow data to be sent at max speed -Wenbing Zhao 52 26

Flow Control and Buffering Dynamic buffer allocation Initially, the sender requests certain number of buffers. The receiver then grants as many of these as it can afford. Every time the sender transmits a TPDU, it must decrement its allocation, stopping altogether when the allocation reaches zero. The receiver then separately piggybacks both acknowledgements and buffer allocations onto the reverse traffic -Wenbing Zhao 53 Flow Control and Buffering Dynamic buffer allocation. The arrows show the direction of transmission. An ellipsis ( ) indicates a lost TPDU. 27

Crash Recovery Router crash / recovery easy to handle How to cope with server host crash and recovery Problem is caused by the non-atomicity of sending ack and delivery of TPDU Problem like this in layer N can only be solved by N+1 Different combinations of client and server strategy 28