Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP/IP. TCP/IP Protocol Suite (1) Physical layer Data-link layer –PPP, ARP, RARP Network layer – IP, ICMP, IGMP, BootP Transport layer _ TCP, UDP, RTP.

Similar presentations


Presentation on theme: "TCP/IP. TCP/IP Protocol Suite (1) Physical layer Data-link layer –PPP, ARP, RARP Network layer – IP, ICMP, IGMP, BootP Transport layer _ TCP, UDP, RTP."— Presentation transcript:

1 TCP/IP

2 TCP/IP Protocol Suite (1) Physical layer Data-link layer –PPP, ARP, RARP Network layer – IP, ICMP, IGMP, BootP Transport layer _ TCP, UDP, RTP Application layer – http, smtp, ftp

3 TCP/IP Protocol Suite (2) Point-to-Point Protocol (PPP): a link layer protocol used in the Internet Address Resolution Protocol (ARP): IP address  Ethernet address Reverse Address Resolution Protocol (RARP): Ethernet address  IP address Bootstrap Protocol (BOOTP): function is similar to RARP, but using UDP messages, and was extended to DHCP (Dynamic Host Configuration Protocol)

4 TCP/IP Protocol Suite (3) Internet Control Message Protocol (ICMP) : monitor or test the Internet Internet Group Management Protocol (IGMP) : manage the membership of IP multicast groups Real-time Transport Protocol (RTP): provides end-to-end network transport functions suitable for applications transmitting real-time data

5 TCP/IP Protocol Suite (4) http: HyperText Transfer Protocol smtp: Simple Mail Transfer Protocol ftp: File Transfer Protocol

6 Internet Protocol (IP) Addressing Routing Fragmentation and Reassembly Quality of Service Multiplexing and Demultiplexing

7 Addressing Need unique identifier for every host in the Internet (analogous to postal address) IP addresses are 32 bits long Hierarchical addressing scheme Conceptually … IPaddress =(NetworkAddress,HostAddress)

8 Address Classes Class A Class B Class C 0 netIdhostId 7 bits24 bits 1 0 netIdhostId 14 bits16 bits 1 1 0 netIdhostId 21 bits8 bits

9 IP Address Classes (contd.) Two more classes 1110 : multicast addressing 1111 : reserved Significance of address classes? Why this conceptual form?

10 Addresses and Hosts Since netId is encoded into IP address, each host will have a unique IP address for each of its network connections Hence, IP addresses refer to network connections and not hosts Why will hosts have multiple network connections?

11 Special Addresses hostId of 0:network address hostId of all 1’s: directed (distant) broadcast All 1’s: limited (local) broadcast netId of 0:this network Loopback :127.0.0.0 Dotted decimal notation: IP addresses are written as four decimal integers separated by decimal points, where each integer gives the value of one octet of the IP address.

12 Dotted decimal notation 11001010, 00100110, 01000000, 00000010 202.38.64.2

13 Exceptions to Addressing Subnetting Splitting hostId into subnetId and hostId Achieved using subnet masks Useful for? Supernetting (Classless Inter-domain Routing or CIDR) Combining multiple lower class address ranges into one range Achieved using 32 bit masks and max prefix routing Useful for?

14 Examples Subnetting 192.168.1.0/24 – class C network 192.168.1.64/26 and 192.168.1.128/26 – 2 subnetworks with upto 62 stations each! Supernetting 192.168.2.0/24 and 192.168.3.0/24 – 2 class C networks 192.168.2.0/23 – 1 super network with upto 510 stations!!

15 Weaknesses Mobility Switching address classes Notion of host vs. IP address

16 IP Routing Direct If source and destination hosts are connected directly Still need to perform IP address to physical address translation. Why? Indirect Table driven routing Each entry: (NetId, RouterId)  Default router  Host-specific routes

17 IP Routing Algorithm RouteDatagram(Datagram, RoutingTable) Extract destination IP address, D, from the datagram and compute the netID N If N matches any directly connected network address deliver datagram to destination D over that network Else if the table contains a host-specific route for D, send datagram to next-hop specified in table Else if the table contains a route for network N send datagram to next-hop specified in table Else if the table contains a default route send datagram to the default router specified in table Else declare a routing error

18 Routing Protocols Interior Gateway Protocol (IGP) Within an autonomous domain RIP (distance vector protocol), OSPF (link state protocol) Exterior Gateway Protocol (EGP) Across autonomous domains BGP (border gateway protocol)

19 IP Fragmentation The physical network layers of different networks in the Internet might have different maximum transmission units The IP layer performs fragmentation when the next network has a smaller MTU than the current network MTU = 1500MTU=500 IP fragmentation

20 IP Reassembly Fragmented packets need to be put together Where does reassembly occur? What are the trade-offs?

21 Multiplexing WebEmailMP3 TCPUDP IP WebEmailMP3 TCPUDP IP IP datagrams

22 IP Header Used for conveying information to peer IP layers Application Transport IP DataLink Physical Application Transport IP DataLink Physical IP DataLink Physical IP DataLink Physical Source Destn Router

23 IP Header (contd.) 16 bit total length 4 bit version 4 bit hdr length 16 bit identification 8 bit TTL8 bit protocol16 bit header checksum 3 bit flags 32 bit source IP address 32 bit destination IP address 13 bit fragment offset Options (if any) (maximum 40 bytes) data 8 bit TOS

24 Internet Protocol (IP): Recap Addressing Routing Fragmentation and Reassembly Quality of Service Multiplexing and Demultiplexing

25 Transmission Control Protocol (TCP)

26 End-to-end transport protocol Responsible for reliability, congestion control, flow control, and sequenced delivery Applications that use TCP: http (web), telnet, ftp (file transfer), smtp (email), chat Applications that don’t: multimedia (typically) – use UDP instead

27 Ports, End-points, & Connections Thus, an end-point is represented by (IP address,Port) Ports can be re-used between transport protocols A connection is (SRC IP address, SRC port, DST IP address, DST port) Same end-point can be used in multiple connections IP Layer TCPUDP http ftp smtptelnet IP address Protocol ID A1A2A3 Transport Port

28 TCP Connection Establishment Connection Maintenance Reliability Congestion control Flow control Sequencing Connection Termination

29 Fundamental Mechanism Simple stop and go protocol Timeout based reliability (loss recovery) Multiple unacknowledged packets (W) data retx ack data ack data Sliding Window Protocol: 1 2 3 4 5 6 7 8 9 10 11 12 ….

30 Active and Passive Open How do applications initiate a connection? One end (server) registers with the TCP layer instructing it to “accept” connections at a certain port The other end (client) initiates a “connect” request which is “accept”-ed by the server

31 Reliability (Loss Recovery) Sequence Numbers TCP uses cumulative Acknowledgments (ACKs) Next expected in-sequence packet sequence number Pros and cons? Piggybacking Timeout calculation Rtt avg = k*Rtt avg + (1- k)*Rtt sample RTO = Rttavg + 4*Rtt deviation ack data 5 1 2 3 4 3 4 3 1 2 3 4 3 3 4

32 Congestion Control Slow Start Start with W=1 For every ACK, W=W+1 Congestion Avoidance (linear increase) For every ACK, W = W+1/W Congestion Control (multiplicative decrease) ssthresh = W/2 W = 1 Alternative: Fall to W/2 and start congestion avoidance directly

33 Why LIMD? (fairness) W=1 10010diff = 90 11diff = 0 Problem? – inefficient W=W/2 10010diff = 90 50 5diff = 45 516diff = 45 527diff = 45.. 7328diff = 45 37.514diff = 23.5.. 61.7538.25diff = 23.5 30.8519.65diff = 11.2..

34 Flow Control Prevent sender from overwhelming the receiver Receiver in every ACK advertises the available buffer space at its end Window calculation MIN( congestion control window, flow control window )

35 Sequencing Byte sequence numbers TCP receiver buffers out of order segments and reassembles them later Starting sequence number randomly chosen during connection establishment Why? 3 1 2 3 4 3 3 4 1 given to app 2 given to app Loss 4 buffered (not given to app) 3 & 4 given to app 4 discarded

36 Connection Establishment & Termination 3-way handshake used for connection establishment Randomly chosen sequence number is conveyed to the other end Similar FIN, FIN+ACK exchange used for connection termination SYN SYN+ACK ACK DATA Server does passive open Accept connection request Send acceptance Start connection Active open Send connection request

37 TCP Segment Format HL 16 bit SRC Port16 bit DST Port 32 bit sequence number 32 bit ACK number 16 bit window size resvd flags 16 bit urgent pointer16 bit TCP checksum Options (if any) Data Flags: URG, ACK, PSH, RST, SYN, FIN

38 TCP Flavors TCP-Tahoe W=1 adaptation on congestion TCP-Reno W=W/2 adaptation on fast retransmit, W=1 on timeout TCP-newReno TCP-Reno + fast recovery TCP-Vegas, TCP-SACK

39 TCP Tahoe Slow-start Congestion control upon time-out or DUP- ACKs When the sender receives 3 duplicate ACKs for the same sequence number, sender infers a loss Congestion window reduced to 1 and slow- start performed again Simple Congestion control too aggressive

40 TCP Reno Tahoe + Fast re-transmit Packet loss detected both through timeouts, and through DUP-ACKs Sender reduces window by half, the ssthresh is set to half of current window, and congestion avoidance is performed (window increases only by 1 every round-trip time) Fast recovery ensures that pipe does not become empty Window cut-down to 1 (and subsequent slow- start) performed only on time-out

41 TCP New-Reno TCP-Reno with more intelligence during fast recovery In TCP-Reno, the first partial ACK will bring the sender out of the fast recovery phase Results in timeouts when there are multiple losses In TCP New-Reno, partial ACK is taken as an indication of another lost packet (which is immediately retransmitted). Sender comes out of fast recovery only after all outstanding packets (at the time of first loss) are ACKed

42 TCP SACK TCP (Tahoe, Reno, and New-Reno) uses cumulative acknowledgements When there are multiple losses, TCP Reno and New-Reno can retransmit only one lost packet per round-trip time What about TCP-Tahoe? SACK enables receiver to give more information to sender about received packets allowing sender to recover from multiple- packet losses faster

43 TCP SACK (Example) Assume packets 5-25 are transmitted Let packets 5, 12, and 18 be lost Receiver sends back a CACK=5, and SACK=(6-11,13-17,19-25) Sender knows that packets 5, 12, and 18 are lost and retransmits them immediately

44 Other TCP flavors TCP Vegas Uses round-trip time as an early- congestion-feedback mechanism Reduces losses TCP FACK Intelligently uses TCP SACK information to optimize the fast recovery mechanism further

45 User Datagram Protocol (UDP) Simpler cousin of TCP No reliability, sequencing, congestion control, flow control, or connection management! Serves solely as a labeling mechanism for demultiplexing at the receiver end Use predominantly by protocols that do no require the strict service guarantees offered by TCP (e.g. real-time multimedia protocols) Additional intelligence built at the application layer if needed

46 UDP Header Src PortDst Port ChecksumLength Length: length of header + data (min = 8)

47 Recap TCP Connection management Reliability Flow control Congestion control TCP flavors UDP


Download ppt "TCP/IP. TCP/IP Protocol Suite (1) Physical layer Data-link layer –PPP, ARP, RARP Network layer – IP, ICMP, IGMP, BootP Transport layer _ TCP, UDP, RTP."

Similar presentations


Ads by Google