Introduction to Networks and the Internet

Similar documents
Introduction to Networks and the Internet

Lecture 3: The Transport Layer: UDP and TCP

User Datagram Protocol

Networking Technologies and Applications

ECE 650 Systems Programming & Engineering. Spring 2018

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

6.1 Internet Transport Layer Architecture 6.2 UDP (User Datagram Protocol) 6.3 TCP (Transmission Control Protocol) 6. Transport Layer 6-1

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

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

What is TCP? Transport Layer Protocol

05 Transmission Control Protocol (TCP)

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

TSIN02 - Internetworking

Transport Layer. Gursharan Singh Tatla. Upendra Sharma. 1

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

TSIN02 - Internetworking

User Datagram Protocol (UDP):

Transport Protocols. Raj Jain. Washington University in St. Louis

TSIN02 - Internetworking

Transport Protocols & TCP TCP

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

II. Principles of Computer Communications Network and Transport Layer

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

Transmission Control Protocol (TCP)

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

TSIN02 - Internetworking

Internet and Intranet Protocols and Applications

QUIZ: Longest Matching Prefix

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

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

UDP, TCP, IP multicast

UNIT IV -- TRANSPORT LAYER

Chapter 24. Transport-Layer Protocols

Applied Networks & Security

Transport Layer Marcos Vieira

CS Lecture 1 Review of Basic Protocols

ECE697AA Lecture 3. Today s lecture

CS4700/CS5700 Fundamentals of Computer Networks

Multiple unconnected networks

NWEN 243. Networked Applications. Layer 4 TCP and UDP

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

EEC-682/782 Computer Networks I

CMPE 150 Winter 2009

The Transport Layer: TCP & Reliable Data Transfer

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

CCNA R&S: Introduction to Networks. Chapter 7: The Transport Layer

Introduction to TCP/IP networking

Introduction to Internet. Ass. Prof. J.Y. Tigli University of Nice Sophia Antipolis

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

ITS323: Introduction to Data Communications

CSC 634: Networks Programming

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

Transport Protocols. ISO Defined Types of Network Service: rate and acceptable rate of signaled failures.

Network Technology 1 5th - Transport Protocol. Mario Lombardo -

TCP : Fundamentals of Computer Networks Bill Nace

CSCD 330 Network Programming

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

Sequence Number. Acknowledgment Number. Data

ECE 435 Network Engineering Lecture 15

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

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

TCP /IP Fundamentals Mr. Cantu

Intro to LAN/WAN. Transport Layer

TCP/IP Protocol Suite 1

Kent State University

Chapter 6. (Week 12) The Transport Layer (CONTINUATION) ANDREW S. TANENBAUM COMPUTER NETWORKS FOURTH EDITION PP

TCP. CSU CS557, Spring 2018 Instructor: Lorenzo De Carli (Slides by Christos Papadopoulos, remixed by Lorenzo De Carli)

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

Transport Layer. <protocol, local-addr,local-port,foreign-addr,foreign-port> ϒ Client uses ephemeral ports /10 Joseph Cordina 2005

Stream Control Transmission Protocol

The Transport Layer. Part 1

Transport Protocols and TCP: Review

CS457 Transport Protocols. CS 457 Fall 2014

Transport Protocols and TCP

Transport Over IP. CSCI 690 Michael Hutt New York Institute of Technology

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

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, steam: r Development of reliable protocol r Sliding window protocols

IS370 Data Communications and Computer Networks. Chapter 5 : Transport Layer

Chapter 5 End-to-End Protocols

Reliable Transport I: Concepts and TCP Protocol

7. TCP 최양희서울대학교컴퓨터공학부

CSCI-GA Operating Systems. Networking. Hubertus Franke

The Transport Layer. Internet solutions. Nixu Oy PL 21. (Mäkelänkatu 91) Helsinki, Finland. tel fax.

ECE 435 Network Engineering Lecture 9

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

CSC 401 Data and Computer Communications Networks

Simulation of TCP Layer

EE 122: Transport Protocols. Kevin Lai October 16, 2002

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

Connection-oriented (virtual circuit) Reliable Transfer Buffered Transfer Unstructured Stream Full Duplex Point-to-point Connection End-to-end service

Programming Assignment 3: Transmission Control Protocol

Outline. TCP: Overview RFCs: 793, 1122, 1323, 2018, Development of reliable protocol Sliding window protocols

CS 640 Introduction to Computer Networks Spring 2009

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

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Reliable Transport I: Concepts and TCP Protocol

TCP/IP-2. Transmission control protocol:

OSI Transport Layer. objectives

TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

Transcription:

Introduction to Networks and the Internet CMPE 80N Announcements Project 2. Reference page. Library presentation. Internet History video. Spring 2003 Week 7 1 2 Today Internetworking (cont d). Fragmentation. IP. IP addressing. Maximum Transfer Unit Each data link layer technology specifies the maximum size of a frame. Called the Maximum Transfer Unit (MTU). Ethernet: 1,500 bytes. Token Ring: 2048 or 4096 bytes. What happens when large packet wants to travel through network with smaller MTU? Maximum payloads (data portion of datagram) range from 48 bytes (ATM cells) to 64Kbytes (IP packets). 3 4

MTU (cont d) Fragmentation A possible solution: The sender may limit the size of the datagrams to the MTU of the network What if there are other networks in the path to destination with smaller MTU? Another solution (used by IP): fragmentation. Gateways break packets into fragments to fit the network s MTU; each sent as separate datagram. Gateway on the other side have to reassemble fragments into original datagram. 5 6 Keeping Track of Fragments Fragmentation - Example Fragments must be numbered so that original data stream can be reconstructed. Define elementary fragment size that can pass through every network. When packet fragmented, all pieces equal to elementary fragment size, except last one (may be smaller). Datagram may contain several fragments. 7 8

Fragmentation Example (cont d) Header contains packet number, number of first fragment in packet, and last-fragment bit. Last-fragment bit 27 0 1 A B C D E F G H I J 1 byte Announcements Quiz 2. Christy Hightower s presentation on 05.22. Project 2. Packet number Number of first fragment (a) Original packet with 10 data bytes. 27 0 0 A B C D E F G H 27 8 1 I J (b) Fragments after passing through network with MTU = 8 bytes. 9 10 The IP Protocol The Internet s Network Layer The Internet as a collection on networks or autonomous systems (ASs). Hierarchical structure. 11 Transcontinental links Regional network US backbone Transcontinental links European backbone National network 12

The Internet Protocol: IP Glues Internet together. Common network-layer protocol spoken by all Internet participating networks. Best effort datagram service: No reliability guarantees. No ordering guarantees. IP (cont d) IP is responsible for datagram routing. Important: each datagram is routed independently! Two different datagrams from same source to same destination can take different routes! Why? Implications? 13 14 IP (cont d) IP IP provides a best effort delivery mechanism Does not guarantee to prevent duplicate datagrams, delayed and out-of-order delivery, corruption of data or datagram loss Reliable delivery is provided by the transport layer, not the network layer (IP) Network layer (IP) can detect and report errors without actually fixing them Transport layer breaks data streams into datagrams which are transmitted over Internet, possibly being fragmented. When all datagram fragments arrive at destination, reassembled by network layer and delivered to transport layer at destination host. 15 16

IP Datagram Format Datagram Header Format IP datagram consists of header and data (or payload). Header: 20-byte fixed (mandatory) part. Variable length optional part. 17 18 IP Versions Addressing IPv4: IP version 4. Current, predominant version. 32-bit long addresses. IPv6: IP version 6. Evolution of IPv4. Longer addresses (16-byte long). Single, uniform addresses. Sending hosts puts destination internetworking address in the packet. Destination addresses can be interpreted by any intermediate router. Router examines address and forwards packet on to the destination. Router at destination delivers packet to appropriate host. 19 20

IP Addresses Each computer (host) on the Internet has a unique IP address. IP address are 32 bits long. 4 billion (2 32 ) addresses. IP addresses are represented in dotted decimal, such as 128.114.144.4 Each group of numbers corresponds to 8 bits. Can go from 0 to 255. IP Addresses (cont d) IP addresses are hierarchical. Divided into a prefix and a suffix Prefix identifies network to which computers are attached. Suffix identifies computers within that network. Remember that two computers in a network can communicate directly. 21 22 Networks and Host Numbers IP Address Format Every network in an internet is assigned a unique network number. Each host on a specific network is assigned a host address that is unique within that network. Host s IP address is the combination of the network number (prefix) and host address (suffix). Assignment of network numbers must be coordinated globally; assignment of host addresses can be managed locally. 23 IP (v4) address are 32 bits long. There are different classes of addresses, corresponding to different subdivisions of the 32 bits into prefix and suffix. Some address classes have large prefix, small suffix. Many networks, few hosts per network. Other address classes have small prefix, large suffix. Few networks, many hosts per network. 24

IP Address Format (cont d) IP Address Formats 1 How can we recognize to which class an IP address belongs to? Look at the first 4 bits! 4 different classes: Network Host Class A: 0XXXXXXX 128 nets. 16M hosts/net. Class B: 16K nets. 10XXXXXX XXXXXXXX 64K hosts/net. Class C: 2M nets. 110XXXXX XXXXXXXX XXXXXXXX 256 hosts/net. Class D: 1110XXXX XXXXXXXX XXXXXXXX XXXXXXXX Multicast. 25 26 IP Address Format (cont d) Class A, B and C are primary classes Used for ordinary addressing. Class D is used for multicast, which is a limited form of broadcast. Internet hosts join a multicast group. Packets are delivered to all members of the group. Routers manage delivery of single packets from source to all members of multicast group. IP Addresses (cont d) Another way to determine the address class is by looking at the first group of numbers in the dotted decimal notation 27 28

Networks and Hosts in Each Class IP addresses: how to get one? The network IP numbers are assigned by the Network Information Center How does host get its IP address in the network? Hard-coded by system administrator in a file. DHCP: Dynamic Host Configuration Protocol Dynamically get address: plug-and-play 29 30 DHCP DHCP allows a computer to join a new network and automatically obtain an IP address The network administrator establishes a pool of addresses for DHCP to assign. When a computer boots, it broadcasts a DHCP request to which a server sends a DHCP reply. Multi-Addresses A router usually has more than one IP address. 129.98.0.0 129.98.95.1 236.240.128.3 80.0.0.8 236.240.128.0 80.0.0.0 Multi-homed host: host with multiple network interfaces each of which has different IP address. 31 32

The Transport Layer The Transport Layer End-to-end. Communication from source to destination host. Only hosts run transport-level protocols. Under user s control as opposed to network layer which is controlled/owned by network provider. 33 34 The Transport Layer Types of Transport Services Source host Application Layer Transport Entity Network Layer Application/ transport interface Transport/ network interface TPDU Destination host Application Layer Transport Entity Network Layer Provided to the application layer. Connection-less versus connection-oriented. Connection-less service: no logical connections, no flow or error control. Connection-oriented: Based on logical connections: connection setup, data transfer, connection teardown. Flow and error control. Reliability and in-order delivery. 35 36

TPDU Transport Protocol Addressing Transport protocol data unit. Messages sent between transport entities. TPDUs contained in network-layer packets, which in turn are contained in DLL frames. Address of the transport-level entity. Several transport-level entities may be running on single machine. Source-destination address pair not enough to uniquely identify transport entity. Port number: uniquely identifies transport entity. Frame header Packet header TPDU header TPDU payload 37 38 The Internet Transport Protocols: TCP and UDP UDP: user datagram protocol (RFC 768). Connection-less protocol. TCP: transmission control protocol (RFCs 793, 1122, 1323). Connection-oriented protocol. TCP Reliable end-to-end communication. TCP transport entity: Interfaces to the IP layer. Manages TCP streams. Accepts user data, breaks it down and sends it as separate IP datagrams. At receiver, reconstructs original byte stream from IP datagrams. 39 40

Features of TCP Connection oriented: An application requests a connection to destination and uses connection to transfer data IP does not uses connections - each datagram is sent independently! Point-to-point: A TCP connection has two endpoints (no broadcast/multicast) Reliability: TCP guarantees that data will be delivered without loss, duplication or transmission errors Features of TCP (cont d) Full duplex: Endpoints can exchange data in both directions simultaneously Reliable connection startup: TCP guarantees reliable, synchronized startup between endpoints (using three-way handshake ) Gracefully connection shutdown: TCP guarantees delivery of all data after endpoint shutdown 41 42 Delivering TCP Segments Delivering TCP TCP segments travel in IP datagrams. TCP at destination interprets TCP messages TCP segment IP header Payload Internet routers only look at IP header to forward datagrams. 43 44

TCP Connection Setup TCP Connection Release 3-way handshake. Host 1 SYN (SEQ=x) Host 2 SYN(SEQ=y,ACK=x+1) (SEQ=x+1, ACK=y+1) Graceful release: Each side of the connection released independently. Either side send TCP segment with FIN=1. When FIN acknowledged, that direction is shut down for data. Connection released when both sides shut down. 4 segments: 1 FIN and 1 ACK for each direction; 1st. ACK+2nd. FIN combined. 45 46 TCP and Reliable Delivery TCP Reliability TCP provides reliable delivery, recovering from: Lost packets Duplicate packets Delayed packets Corrupted data Source/destination mismatches Congestion Reliable delivery. Acknowledgements.. Timeouts and retransmissions. Ordered delivery. Sequence numbers. 47 48

Lost Packets Recipient sends acknowledgment control message (ACK) to sender to verify successful receipt of data ACKs usually are carried onboard other TCP packets. However, even if an application has nothing to transmit, it must transmit acknowledgment packets for each packet it receives. Thus, for each packet sent, a host expects to receive an acknowledgment, which ensures that the packet did not get lost. What if the packet or the acknowledgment get lost? 49 Lost Packets (cont d) Retransmission timer When a data segment is sent, a timer is started If the segment is acknowledged before the timer expires, the timer is stopped and reset Otherwise, the segment is retransmitted (and the timer is reset and started again) The choice of the timeout is critical! If timeout is too long: overall throughput may be reduced (always waiting for acknowledgments) If timeout is too short: too many packets get retransmitted (may increase network congestion) 50 Lost Packets (cont d) Lost Packets - Example IMPORTANT: packet retransmission (especially if it has to be carried out on an end-to-end basis) significantly increases latency (delay) For real-time video or audio transmission, delay is a more important performance issue than error rate Thus, in many cases it is preferable to forget the error and simply work with the received data stream 51 52

TCP Transmission TCP Transmission (cont d) Sender process initiates connection. Once connection established, TCP can start sending data. Sender writes bytes to TCP stream. TCP sender breaks byte stream into segments. Each byte assigned sequence number. Segment sent and timer started. If timer expires, retransmit segment. After retransmitting segment for maximum number of times, assumes connection is dead and closes it. If user aborts connection, sending TCP flushes its buffers and sends RESET segment. Receiving TCP decides when to pass received data to upper layer. 53 54 Flow Control TCP Flow Control Flow control is necessary so that source doesn t transmit too fast for given receiver. E.g., a fast server trying to send 1Gb/s data to a small PC. Without some form of control, some data will get lost. Sliding window. Receiver s advertised window. Size of advertised window related to receiver s buffer space. Sender can send data up to receiver s advertised window. 55 56

TCP Sliding Window TCP Flow Control: Example App. writes 2K of data 2K;SEQ=0 4K ACK=2048; WIN=2048 2K 57 App. does 3K write Sender blocked Sender may send up to 2K 2K; SEQ=2048 ACK=4096; WIN=0 ACK=4096; WIN=2048 1K; SEQ=4096 0 App. reads 2K of data 2K 1K 58 Congestion Congestion Control Network with 1 Mb/s lines and 1000 computers, half of which are trying to transfer files at 100 Kb/s to the other half. The total offered traffic exceeds what the network can handle (congestion). Congestion collapse: When congestion occurs, packets get dropped. Due to packet loss, packets get retransmitted. Congestions gets worse and worse! Why do it at the transport layer? Real fix to congestion is to slow down sender. Use law of conservation of packets. Keep number of packets in the network constant. Don t inject new packet until old one leaves. Congestion indicator: packet loss. 59 60

TCP and Congestion Control Interprets packet loss as an indicator of congestion When it senses packet loss, it slows down the rate of packet transmission When packets are received correctly, sends packets faster Still within the limits of the sliding window TCP Congestion Control Like, flow control, also window based. Sender keeps congestion window (cwin). Each sender keeps 2 windows: receiver s advertised window and congestion window. Number of bytes that may be sent is min(advertised window, cwin). 61 62 TCP Congestion Control (cont d) Slow start [Jacobson 1988]: Connection s congestion window starts at 1 segment. If segment ACKed before time out, cwin=cwin+1. As ACKs come in, current cwin is increased by 1. Exponential increase. TCP Congestion Control (cont d) Congestion Avoidance: Third parameter: threshold. Initially set to 64KB. If timeout, threshold=cwin/2 and cwin=1. Re-enters slow-start until cwin=threshold. Then, cwin grows linearly until it reaches receiver s advertised window. 63 64

TCP Retransmission Timer How to set timer? When segment sent, retransmission timer starts. If segment ACKed, timer stops. If time out, segment retransmitted and timer starts again. Based on round-trip time: time between a segment is sent and ACK comes back. If timer is too short, unnecessary retransmissions. If timer is too long, long retransmission delay. 65 66 TCP Segment Header TCP Header Fields Header length Source port Sequence number Acknowledgment number UA P R S F Destination port Window size Checksum Urgent pointer Options (0 or more 32-bit words) Data Source and destination ports identify connection end points. Sequence number. Acknowledgment number specifies next byte expected. TCP header length: how many 32-bit words are contained in header. 6-bit unused field. 67 68

TCP Header Fields (cont d) TCP Header Fields (cont d) 6 1-bit flags: URG: indicate urgent data present; urgent pointer gives byte offset from current sequence number where urgent data is. ACK: indicates whether segment contains acknowledgment; if 0, acknowledgement number field ignored. PUSH: indicates PUSHed data so receiver delivers it to application immediately. Flags (cont d): RST: used to reset connection, reject invalid segment, or refuse to open connection. SYN: used to establish connection; connection request, SYN=1, ACK=0. FIN: used to release connection. Window size: how many bytes can be sent starting at acknowledgment number. 69 70 TCP Header Fields (cont d) UDP Checksum: checksums the header+data+pseudo-header. Options: provide way to add extra information. Examples: Maximum payload host is willing to accept; can be advertised during connection setup. Window scale factor that allows sender and receiver to negotiate larger window sizes. Provides connection-less, unreliable service. No delivery guarantees. No ordering guarantees. No duplicate detection. Low overhead. No connection establishment/teardown. Suitable for short-lived connections. Example: client-server applications. 71 72

UDP Segment Format 0 15 31 Source port Length Data Destination port Checksum Source and destination ports: identify the end points. Length: 8-byte header+ data. Checksum: optional; if not used, set to zero. TCP and UDP TCP provides end-to-end communication. It takes care of reliable, error-free transfer of data, and insequence delivery UDP has less overhead compared to TCP, but does not guarantee transfers TCP is preferred to transfer files UDP is preferred to transfer audio/video streams In real-time streaming, we cannot afford the delay consequent to packet retransmission Both protocols support multiplexing, i.e. they allow several distinct streams of data between two hosts 73 74