Just enough TCP/IP Borrowed from my ITS475/575 class the ITL 1 Protocol Overview E-Mail HTTP (WWW) Remote Login File Transfer TCP UDP RTP RTCP SCTP IP ICMP ARP RARP (Auxiliary Services) Ethernet, X.25, HDLC etc. ATM 2 Connection Types in TCP/IP Transport Layer TCP: Connection Oriented RTP,UDP: Connection-less Network Layer Connection-less Data Link Layer and Physical Network Depends on the network 3 Control Mechanisms Connection-Less traffic Packets representing overload are discarded Retransmissions should not take place Applications should adapt Connection-Oriented traffic Packets representing overload are also discarded Lost packets must be retransmitted Hosts must adjust sending rate 4
IP Addresses IP (v4) addresses are 32 bits long We normally divide them into 4 bytes, each 8 bits long Normally represented in dotted decimal notation, for example: A 32-bit number in binary 10000100 11101011 11001001 00000010 The same 32-bit number expressed in dotted decimal notation 132.235.201.2 5 What is Routing We start with the idea of a single physical network May include repeaters (hubs) May include bridges (switches) To tie together multiple networks, we use an internet gateway Machine with an interface on multiple physical networks Forms an internet (or The Internet ) Dedicated gateway box is normally called a Router 6 IP Routing IP packets are called datagrams To send a datagram to a machine on the local network, you send directly to its hardware address To send a datagram to a machine that is not on the local network, you need to send it to the router This leads to the question: How do you know if the destination machine is on the local network? 7 Address Mask The address mask (or subnet mask ) is used to determine whether a destination IP address is on the local network and can be reached directly or is non-local and must be reached through a router. The address mask shows which bits of a destination IP address must be identical to the local IP address for the destination machine to be on the local network. Address masks are also used to select entries in routing tables 8
Address Mask Examples Local IP address 132.235.201.2 Address mask 255.255.0.0 Which of the following is local 132.235.3.1 132.235.201.10 132.235.201.100 132.235.201.200 128.10.2.1 Now try with address mask 255.255.255.0 Now try with address mask 255.255.255.192 9 Address Mask Shorthand Representing the mask in the same format as an address is more general Handles non-contiguous masks (But the standards in use today do not allow them). Some commands insist on this format As shorthand, you can just give the size of the mask 132.235.0.0/16 All of OU 132.235.201.0/24 All 201 Subnet addresses 132.235.201.64/28 A block of 16 addresses inside the 201 subnet 132.235.201.131/32 A specific address 10 TCP/IP Configuration When configuring a TCP/IP stack, you normally need to specify IP address Address mask Router address To be able to reach non-local hosts Must be an IP address on the local network This includes VoIP phones User Interface can be tricky! 11 Other Topics Mapping between IP addresses and hardware (e.g. Ethernet) addresses. ARP (Address Resolution Protocol) Mapping names to IP addresses DNS (Domain Name System) 12
TCP and UDP 13 UDP Header Source Port Destination Port Length Checksum 14 TCP Header Source Port Destination Port Sequence Number Acknowledgement Number misc Flags Checksum Window (flow cntrl) Urgent Options 15 TCP Connection Setup Three-Way Handshake Send SYN packet Wait for peer to return a SYN/ACK packet Acknowledge the SYN/ACK packet 16
17 TCP Connection Termination Send a FIN packet Wait to receive acknowledgement of FIN TCP Data Exchange Sequence Number Acknowledgement Number Sequence Numbers - Sliding Window Arbitrary initial setting Labels the first byte of the segment Acknowledgements Indicate the next byte the receiver is looking for, all previous bytes have been received. 18 Congestion or, why do we need controls? Lets assume 50Mbps link from an ISP to the Internet 200 customers online 50 packets per customer (1500bytes each) in queue 10,000 packets 15,000,000 bytes 120,000,000 bits 2.4 second queue delay Queue size must be controlled 19 Sliding Window flow control Invented to control flow to slower devices (i.e. end-to-end Almost accidentally provides a cap on data flow rate TCP uses a sliding window mechanism for multiple purposes Rate Control Congestion Control/Avoidance The window size is dynamically adjusted 20
21 Sliding Window 1 2 3 M 1 2 3 M 1 2 3 M Idle Time Round Trip Time Slow Start Congestion Control 1 1 2 1 1 2 1 2 3 4 Idle Time Idle Time Note: recent TCP amendments permit more than 1 initial segment Window doubles in each cycle 22 Timing Round-Trip Time (RTT): Combination of Frame Transmission times on intermediate links Frame propagation times on all links Queue wait times in all intermediate nodes Jitter Variation in delay (in practice the same as variation in RTT) 23