Download presentation
Presentation is loading. Please wait.
Published byGwenda Thompson Modified over 8 years ago
1
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC). ARP does this job. It takes IP address and gives corresponding physical address.
2
TCP/IP: Basics2 How ARP Works? There are three methods 1) Table look up 2) Closed form computation 3) Message Exchange In table look up the mapping information is stored in a table in the computer’s memory. In closed form method an algorithm is used to map IP address to a physical address.
3
TCP/IP: Basics3 How ARP Works? In message exchange, a message is broadcast to all the computer on the network with the IP address. The computer with that IP address sends its physical address which is maintained in a cache. ARP is local, that is, it is done on local network.
4
TCP/IP: Basics4 Transmission Control Protocol Transmission Control Protocol or TCP provides: –Reliability Error Control Loss Control Sequence Control Duplication Control –Point to Point or Port to Port Communication –Full duplex –Connection Oriented
5
TCP/IP: Basics5 ??? TCP uses IP for data delivery (like UDP) Endpoints are identified by ports (like UDP) –Allows multiple connections on each host –Ports may be associated with an application or a process IP treats TCP messages like data and does not interpret any contents of the TCP message.
6
TCP/IP: Basics6 ??? TCP message travels in IP datagrams. Internet routers only look at IP header to forward datagrams. TCP at destination interprets TCP messages.
7
TCP/IP: Basics7 TCP Segment Format Same header format used in both directions Segment can carry both data and acknowledgment. Flag field has 6 1-bit flags. SYN = 1 means request to establish connection. FIN = 1 means end of connection.
8
TCP/IP: Basics8 Ports and Socket A single computer can be running several applications (email, FTP, HTTP and others). TCP is application to application (port to port) protocol, IP is computer to computer protocol. TCP uses port numbers to identify different application running on a single computer. A port is a 16-bit number allocated to a particular application.
9
TCP/IP: Basics9 Ports and Socket A port identifies a single application on a computer. A socket or socket address is IP address and port number concatenated together. Example: 192.20.10.10:80 This enables multiple application on one machine to communicate simultaneously. Normally server port numbers are fixed and known as well known ports so that client can send a request to a known application.
10
TCP/IP: Basics10 Ports and Socket A Typical Scenario When a client application sends a TCP request to a server application, it provides server application port number. The TCP software on client allocates an unused port number to that client application. The server receives the request and TCP software passes it to the intended server application. The server replies with its own port number and the client port number.
11
TCP/IP: Basics11 Client Source port number = 80 Destination port number = 23 Source port number = 23 Destination port number = 80 Source Ports and Socket A Typical Scenario
12
TCP/IP: Basics12 Delivery in TCP
13
TCP/IP: Basics13 Three-way Handshake TCP uses three-way handshake for reliable connection establishment and termination –Host 1 sends segment with SYN bit set and random sequence number. –Host 2 responds with segment with SYN bit set, acknowledgment to Host 1 and random sequence number. –Host 1 responds with acknowledgment.
14
TCP/IP: Basics14 Closing a Connection
15
TCP/IP: Basics15 TCP Connection Types TCP has two types of connections: –Non Persistent connection –Persistent connection In non persistent connection TCP connection is closed by the server once the client request is served. In persistent connection the connection is not closed and client can use it as many time as needed.
16
TCP/IP: Basics16 TCP Connection Types There are two types of persistent connections. –Without pipelining –With pipelining Without pipelining the new request could be sent to the sever only once the previous request is served With pipelining several requests can be made simeltaneously.
17
TCP/IP: Basics17 Reliable Delivery TCP uses many techniques described earlier to provide reliable delivery Recovers from –Lost packets –Duplicate packets –Delayed packets –Corrupted data –Transmission speed mismatches –Congestion –System reboots
18
TCP/IP: Basics18 Lost Packets TCP uses positive acknowledgment with retransmission to achieve reliable data delivery Recipient sends acknowledgment control messages (ACK) to sender to verify successful receipt of data Sender sets timer when data transmitted; if timer expires before acknowledgment arrives, sender retransmits (with new timer)
19
TCP/IP: Basics19 Lost Packets
20
TCP/IP: Basics20 TCP Segments Application delivers arbitrarily large chunks of data (blocks) to TCP as a “stream”. TCP breaks this data into segments, each of which fits into an IP datagram. Original stream is numbered by bytes. Segment contains sequence number of data bytes.
21
TCP/IP: Basics21 Acknowledgements Receiver sends segment with sequence number of acknowledged data (not segments). One ACK can acknowledge many segments.
22
TCP/IP: Basics22 Timeout Inappropriate timeout can cause poor performance: –Too long - sender waits longer than necessary before re-transmitting –Too short - sender generates unnecessary traffic Timeout must be different for each connection and set dynamically –Host on same LAN should have shorter timeout than host 20 hops away –Delivery time across internet may change over time; timeout must accommodate changes
23
TCP/IP: Basics23 RTOs for Different Network Delays
24
TCP/IP: Basics24 Choosing RTO Timeout should be based on round trip time or delay (RTT) Sender estimates RTT for each active connection by measuring the time needed to receive a response. Updated dynamically. Sender picks retransmission timeout (RTO) based on previous RTTs Specific method is call adaptive retransmission algorithm
25
TCP/IP: Basics25 TCP Sliding Window TCP uses sliding window for flow control. Receiver specifies window: –Called window advertisement –Specifies which bytes in the data stream can be sent –Carried in segment along with ACK Sender can transmit any bytes, in any size segment, between last acknowledged byte and within window size.
26
TCP/IP: Basics26 TCP Sliding Window
27
TCP/IP: Basics27 TCP Sliding Window with Acknowledgements
28
TCP/IP: Basics28 Congestion Control Excessive traffic can cause packet loss. –Transport protocols respond with retransmission. –Excessive retransmission can cause congestion collapse. TCP interprets packet (segment) loss as an indicator of congestion. Sender uses TCP congestion control and slows transmission of packets when a packet is lost. –Sends single packet.
29
TCP/IP: Basics29 Congestion Control –If ACK returns without loss, sends two packets, and if two ACKs return, sends four packets, and so on, doubling each time until….one half window size. –When TCP sends one-half window size, rate of increase slows.
30
TCP/IP: Basics30 Summary UDP provides end-to-end best-effort message delivery –IP used for delivery to destination host –Protocol ports demultiplex to destination application TCP provides end-to-end reliable byte stream delivery –IP used for delivery to destination host –Protocol ports demultiplex to destination application –Additional techniques develop reliable delivery from IP messages.
31
TCP/IP: Basics31 Summary Positive acknowledgment with retransmission Sequence numbers detect missing, duplicate and out-of-order data Sliding window flow control Three-way handshake Congestion control
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.