Review of TCP/IP.

Slides:



Advertisements
Similar presentations
TCP/IP Christopher Zacky. lolwut Decimal Numbers.
Advertisements

Laboratório de Teleprocessamento e Redes1 Unix Network Programming Prof. Nelson Fonseca
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transmission Control Protocol (TCP)
Fundamentals of Computer Networks ECE 478/578 Lecture #20: Transmission Control Protocol Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
TCP & UDP - Protocol Details Yen-Cheng Chen
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
Networks I Transmission Control Protocol Instituto Tecnológico y de Estudios Superiores de Monterrey Campus Estado de México Prof. MSc. Ivan A. Escobar.
Transmission Control Protocol (TCP) Basics
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.
BZUPAGES.COM 1 User Datagram Protocol - UDP RFC 768, Protocol 17 Provides unreliable, connectionless on top of IP Minimal overhead, high performance –No.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Chapter 7 – Transport Layer Protocols
EECC694 - Shaaban #1 lec #12 Spring Internet Transport Protocols Transmission Control Protocol (TCP):Transmission Control Protocol (TCP):
TELE202 Lecture 14 TCP/UDP (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (1) »Source: chapter 17 ¥This Lecture »TCP/UDP (2) »Source: chapter.
Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
TCP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
CSE 461: Transport Layer Connections. Naming Processes/Services  Process here is an abstract term for your Web browser (HTTP), servers (SMTP),
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
CSCE 515: Computer Network Programming TCP Details Wenyuan Xu Department of Computer Science and Engineering.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
1 ELEN 602 Lecture 15 More on IP TCP. 2 byte stream Send buffer segments Receive buffer byte stream Application ACKs Transmitter Receiver TCP Streams.
Transport Layer TCP and UDP IS250 Spring 2010
Gursharan Singh Tatla Transport Layer 16-May
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 12 Transmission Control Protocol (TCP) Basics.
Process-to-Process Delivery:
The Transport Layer.
Transport Layer: TCP and UDP
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
7: TCP Last Modified: 4/26/2017 1:52:15 PM 3: Transport Layer.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 Transmission Control Protocol (TCP) RFC: Introduction The TCP is intended to provide a reliable process-to-process communication service in a.
Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal – Overhead.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Advanced Computer Networks
Introduction To TCP/IP Networking Mr. Zeeshan Ali, Asst. Professor
Fast Retransmit For sliding windows flow control we waited for a timer to expire before beginning retransmission of a packet TCP uses an additional mechanism.
Introduction to TCP/IP networking
5. End-to-end protocols (part 1)
Chapter 17 and 18: TCP is connection oriented
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
TCP.
PART 5 Transport Layer Computer Networks.
TCP/IP Transmission Control Protocol / Internet Protocol
TCP - Part I Karim El Defrawy
CSCI-1680 Transport Layer I
TCP State Machine (TCP/IP Illustrated vol. 1) W. Richard Stevens
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Process-to-Process Delivery:
Chapter 12 Transmission Control Protocol
TRANSMISSION CONTROL PROTOCOL
PART 5 Transport Layer.
7: TCP Last Modified: 4/10/ :16:43 AM 3: Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Presentation transcript:

Review of TCP/IP

TCP/IP Four layer Architecture Developed in 1960’s Open System Not just one protocol, whole family. Many programming interfaces available. Standardised protocol set.

IP Addressing Scheme Need capability of mapping addresses of one type onto another. LAN address, Network Point of Attachment NPA, must be mapped onto an IP address. NPA formats differ from one LAN standard to another. IP addresses are homogenous within single IP version.

IP Address Format 24 bits 7 bits netid hostid Class A 16 bits 14 bits netid hostid Class A 16 bits 14 bits Class B 10 netid hostid 21 bits 8 bits Class C 110 netid hostid 28 bits Class D 1110 Multicast group ID

IP Address Format (cont.) Different size networks may use different address classes, defined by the first few bits in the address. 0 for Class A, 10 for Class B, 110 for Class C, etc. etc. Networks with large numbers of hosts may use Class A, while Class C may have many subnets with a small number of attached hosts.

IP Address Notation A decimal dot notation is used to break down the IP address. Example 10001000 11001110 00001011 00000110 gives the address 136.206.11.6 aka boole ! Note that this is a Class B address (first zero in second position) and the subnet is defined with 14 bits, the host address with 16 bits.

IP Allocations A central authority has responsibility for allocation of IP addresses. They are the network Information center, or NIC.

Specail IP Addresses Class D addresses are for multicasting. Class E are experimental Private blocks include 10.0.0.0 – 10.255.255.255 (10.0.0.0/8) 172.16.0.0 – 172.31.255.255 (172.16.0.0/12) 192.168.0.0 – 192.168.255.255 (192.168.0.0/16) 127.0.0.1 Loopback address

Subnetting Subnetting allows for the creation of multiple logical networks within a single Class A, B or C network Instead of using 16 bits for the hosts, divide the host space up into 2, a subnet and a host If you have a Class B network, you can connect up to 64 thousand hosts. Think of DCU. Need to break up network into EE, CA, Communications, etc., so we subnet the network Subnet masks Class A = 255.0.0.0 Class B = 255.255.0.0 Class C = 255.255.255.0

Subnetting a Class B network 512 networks, 126 hosts /25 10 Network Subnet Network Host 254 networks, 254 hosts /24 10 Network Subnet Network Subnet Host 128 networks, 510 hosts /23 10 Network Subnet Network Subnet Host 64 networks, 1,022 hosts /22 10 Network Subnet Network Subnet Host 10 Network Subnet Network Subnet Host 32 networks, 2,046 hosts /21

Subnetting Normally when a router receives a packet it looks at the IP address and decides if it is local or has to sent elsewhere. Entries look like (network, 0) and (this-network, host). The routing table has entries for local packets as well as distant packets. A router only needs to know about its local hosts, some other networks and where to send all other packets With subnetting an extra entry is added to the routing table stating (this-network, subnet, 0) and (this-network, this-subnet, host) This way a router knows about all of its own hosts and how to get to the other subnets

Subnet Mask Router has a subnet mask telling it the split between (subnet) networks and hosts Subnetting is not visible outside the network Boolean AND to remove host part 136.206.19.34 255.255.255.0 136.206.19.0

Subnetting To recap, subnetting divides an organisations single class A, B or C network into multiple logical networks by dividing the original host identifier string into two, with the first string representing the subnet and the second representing the hosts Routers use a subnet mask to determine if a packet is to be routed to the current network, another network in the subnet or a distant network

TCP/IP Encapsulation Application TCP IP 802.3 user Data Appl Hdr user header Application Data TCP IP header TCP header Application Data IP Ethernet header IP header TCP header Application Data Ethernet trailer 802.3

TCP Segment Header 16-bit source port number 16-bit destination port number 32-bit sequence number 32-bit acknowledgement number 4bit hdr length reserved u r g A C K P S H R S T S Y N F I N 16-bit window size 16-bit TCP checksum 16-bit urgent pointer Options (if any) Data (if any)

TCP Header Description Source Port and Destination Port identify transport end-points of connection. Sequence Number and Acknowledgement Number perform usual functions, Ack numbers next byte expected. TCP Header Length indicates number of 32 bit words in header. Length varies because of options. Not used. No bug fixes required !

Six one bit flags… URGent pointer in use, used for indicating interrupts and offset from seq no. to urgent data. ACK bit used to indicate piggybacked acknowledgement. PSH requests that receiver does not buffer but to deliver. RST is reset connection, means problems ! SYN used in conjunction with ACK to request connection. FIN release connection

Window size used for variable-sized sliding window Window size used for variable-sized sliding window. Size of zero indicates a choke packet. Checksum checks header. Options field for things like specification of maximum TCP payload. Negotiated at startup lowest bid wins. A selective repeat instead of go-back-n sliding window protocol may be specified as an option.

TCP Addressing TCP uses notion of Port Number to access transport endpoint on a single host. Many Ports may be in use simultaneously. Combination of IP address and port number uniquely identifies a port for process running on a particular machine. Process may even have several ports open.

TCP Services Provides connection-oriented, reliable, byte stream service. Segments passed to IP for routing, timer attached for each segment. Sliding window protocol utilised with go-back-n or selective-repeat for retransmission. All TCP segments acknowledged.

TCP segments may arrive out of order, sliding window will sort order. TCP segments may be duplicated, duplicated are discarded. TCP provides flow control, no process\host will be swamped, helps avoid congestion. TCP utilised by many internet applications such as Telnet, Rlogin, FTP, E-mail, WWW Browsers.

What programmers need to know TCP – The Guts What programmers need to know

Three Way Handshake Socket, Bind, Listen Socket Accept(blocks) Connect(blocks) (active open) SYN J SYN K, ack J+1 Connect returns Ack K+1 Accept returns Read(blocks

Server prepares connection socket, bind, listen. This is a passive open. Client issues active open by calling connect. Issues a SYN segment with sequence no. Contains IP header, TCP header and possible TCP options (next slide) Server acks clients SYN with its own SYN with initial sequence no that server will send. The SYN and ACK are sent is the same segment. Client acknowledges the servers SYN 3 packets are sent (minimum) so called 3-way-handshake.

Common TCP Options in SYN MSS: maximum segment size (Stevens Ch 7.9) Window Scale Option: max window 65535 (16 bit size). Window may be scaled (left shifted) by 0-14 bits giving amx window size of 65535 x 214. Only used if both sender and receiver agree. Timestamp option: used on hi-speed connections to prevent corruption due to reappearing packets, negociated similarely to above. Latter two called RFC 1332 options, or “long fat pipe options”

TCP Connection Termination If application calls close forst, this is an active close. Sends FIN segment, meaning finished sending data. Server performs passive close. Clients FIN is ack’ed and sent to application as EOF, after any queued data to receive. When application receives its EOF, it will close its socket. TCP sends FIN. The server on receiving final FIN acks that FIN.

FIN M ack M+! FIN N ack N+1 Close (active close) (passive close) read returns 0 close ack M+! FIN N ack N+1

TCP SDT Normal client transitions Normal Server transitions appl: Application issues operation recv: segment received send: what is sent for this transition The netstat application uses the state names from this diagram, try it out.

starting point closed listen active open SYN_RCVD SYN_SENT ESTABLISHED appl:passive open send<nothing> Appl: active open Send SYN listen recv: SYN; send: SYN, ACK active open recv: RST recv: SYN send: SYN, ACK simultaneous open SYN_RCVD SYN_SENT recv:ACK send<nothing> recv:SYN, ACK send: ACK ESTABLISHED data Transfer state CLOSE_WAIT recv: FIN send: ACK appl: close send: FIN appl: close send: FIN recv: ACK send: <nothing> LAST_ACK

CLOSING FIN_WAIT_1 TIME_WAIT FIN_WAIT_2 appl: close send: FIN simultaneous close recv:FIN send: ACK FIN_WAIT_1 CLOSING recv: FIN, ACK send: ACK recv: ACK send: <nothing> recv: ACK send: <nothing> recv: FIN send: ACK TIME_WAIT FIN_WAIT_2 2MSL timeout

11 states defined. Rules of TCP apply… If application performs active open in CLOSED state, TCP sends SYN and new state is SYN_SENT. If TCP next receives a SYN with an ACK, it sends an ACK and the new stste is ESTABLISHED Two arrows leading from ESTABLISHED deal with termination. If application calls close before receiving eof (active close), transits to FIN_WAIT_1 If application receives FIN while ESTABLISHED (passive close), transits to CLOSE_WAIT

TCP Connection & The Packets A complele TCP connection involves many packet exchanges. Connection establishment Data transfer Connection termination TCP states are also shown as client and server enter them.

Client Server socket, bind, listen LISTEN(passive open) accept(blocks) SYN_RCVD ESTABLISHED accept returns read(blocks) read returns <server process request> write CLOSE_WAIT(passive close) read returns 0 close LAST_ACK CLOSED SYN J, mss=1460 Socket Connect(blocks) (active open) SYN_SENT ESTABLISHED Connection returns <client forms request> Write Read(blocks) Read returns Close (active close) FIN_WAIT_1 FIN_WAIT_2 TIME_WAIT SYN K, ack J+1, mss=1024 ack K+1 Data (request) Data reply Ack of request ack of reply FIN M ack M+! FIN N ack N+1

Client announces MSS 1460, typical for Ethernet, Ok if different in each direction. Once connection established, clients forms request for server. Server processes request and replies with piggybacked ack. Termination by client (active close) enters TIME_WAIT state, 2MSL (Maximum Segment Lifetime) to deal with lost or wandering IP packets.