TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
Published byModified over 4 years ago
Presentation on theme: "TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,"— Presentation transcript:
Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed, cost, distance; Different standards for: Expected carrier; Coding bits; Detecting and recovering from errors; Protocols for transmitting messages: bus, token ring,… Packets sizes, and encoding for the start/end of packets,… Types of computer addresses
Spring 2002Computer Networks Applications Solution: Routers Router High speed connection Routers: computers design to interconnect different networks
Spring 2002Computer Networks Applications Solution: Internet Protocol (IP) Divide a message in small blocks, called packets; IP protocol for transmitting packets; IP hides the details of physical networks; Every computer connected to the Internet must run IP software IP specifies: Packet format; How routers should forward packets Define address format
Spring 2002Computer Networks Applications IP can be overrun Consider the following scenario: Computers X and Y send simultaneously messages to a computer Z across the same network, d; Both X and Y send 5000 packets/s Network d may transmit 5000 packets/s; There is an excess of 5000 packets each second which are discarded.
Spring 2002Computer Networks Applications IP can be overrun (cont.) TCP (Transmission Control Protocol) designed to handle this problem. XYZ
Spring 2002Computer Networks Applications TCP Checks for lost datagrams; Routers may fail TCP chooses new paths; Because datagrams may travel different paths, they can arrive at the destination in a different order TCP assembles them in the correct order Network failure may result in multiple copies of the same datagram TCP checks for duplicate datagrams, and accepts only the first copy
Spring 2002Computer Networks Applications TCP- a connection oriented protocol IP: a connectionless protocol, i.e. there is no connection between sender and destination; In order to achieve its goals TCP establishes a connection between two computers; A data transmission proceeds much like a telephone call: The sender program contact the destination The destination accepts the incoming call; The sender and destination may exchange arbitrary amounts of data; Any of the party may terminate the communication
Spring 2002Computer Networks Applications Recovering lost datagrams Problem: datagrams may be lost by a router far away from the sender or the destination; Solution: TCP includes a unique ID in each datagram; Whenever data arrives at the destination, it sends an acknowledgment (ack) back to the source, containing the ID of the datagram; If an ack is not received in a certain time the sender retransmits the message.
Spring 2002Computer Networks Applications Example of retransmission
Spring 2002Computer Networks Applications Retransmission is adaptive Different values for waiting times: Short, if source and destination are “close” to each other; Longer, if they are far apart. Adjusted if delays occur TCP measures the delay in sending a message and adjusts the timer
Spring 2002Computer Networks Applications Retransmission examples
Spring 2002Computer Networks Applications Detecting duplicate datagram The receiver maintains a table with all datagrams received so far; When the destination, receives a datagram, checks the ID of incoming with the IDs of the datagrams received so far; If it is a duplicate, the datagram is discarded.
Spring 2002Computer Networks Applications TCP and IP work together IP specifies how a packet should be transmitted from the sender to the destination; TCP specifies ways for making packet transmission reliable; TCP/IP often used and sold as a single software packet.
Spring 2002Computer Networks Applications Designing Protocols Two possible solutions: A single, giant protocol that specifies all details; Cons: difficult to design, and to update Divide the problem into subpieces, and design a special protocol for each piece; Each piece is called a layer; The result: a suite of protocols; Requires that different parts share information.
Spring 2002Computer Networks Applications TCP/IP---a layered protocol Has seven layers; Lowest layer refers to hardware; Top layers refer to the software; The level of abstraction increases bottom to top.
Spring 2002Computer Networks Applications TCP/IP layers: Layer 1 (Physical layer): Corresponds to network hardware; defines the carrier, the way to encode bits, etc.. Example of a carrier
Spring 2002Computer Networks Applications TCP/IP layers (cont.) the carrier is reduced to 2/3 full strength to encode a 1 bit, and 1/3 strength to encode a 0 bit; Two successive pulses needed to encode one bit; an unchanged pulse separates two bits. Digital signal The resulting wave encoding The signal above.
Spring 2002Computer Networks Applications TCP/IP layers (cont.) Layer 2: data link Specifies how to organize data into packets, and how to transmit packets over a network For ex: maximum packet size, format packet header, checksum computation are defined at this layer.
Spring 2002Computer Networks Applications TCP/IP layers (cont.) Layer 3: Network Specifies how addresses are formed Ex: IP addresses How packets are forwarded: Ex: store and forward technique Layer 4: Transport Handles details of reliable transfer; EX: format of acks, retransmission times, rules for changing it
Spring 2002Computer Networks Applications TCP/IP layers (cont.) Layer5: Session Specifies how to establish a communication with a remote system; ex: telnet Authentication details; ex: passwords Layer 6: Presentation Specifies how to represent data; Different computers use different internal representation (Ex: ASCII, EBDIC) for integers and characters; How to translate from one representation to another
Spring 2002Computer Networks Applications TCP/IP layers (cont.) Layer 7: Application Specifies how one particular application uses a network; Ex: FTP Specifies request format (how to name a file) and how the application on another machine responds.
Spring 2002Computer Networks Applications How layered software works Each layer solves one part of the problem; To do so, each layer on the sending computer adds information to the outgoing data; The same layer in the receiving computer uses the additional information to process data; Ex: checksums in data layer;
Spring 2002Computer Networks Applications How layered software works (cont.) Layering Principle: Layer N software on the destination computer, must receive the exact message sent by layer N software on the sending computer. Ex: if one layer adds a header, the corresponding layer has to remove it. If one layer encrypts data, the receiving computer layer has to decrypt it.
Spring 2002Computer Networks Applications Why layering? Each layer can be: Designed, Implemented Tested independently of other layers. creating and evolving protocols, much easier task.