TCP/IP

Created by Rachita Ghoshhajra

TCP/IP Transmission Control Protocol / Internet Protocol Family of protocols used in computer communication TCP and IP are two different protocols A computer communication protocol is a description of the rules computers must follow to communicate with each other. .

TCP/IP Inside the TCP/IP standard there are several protocols for handling data communication: TCP (Transmission Control Protocol) for communication between applications UDP (User Datagram Protocol) for simple communication between applications IP (Internet Protocol) for communication between computers ICMP (Internet Control Message Protocol) for errors and statistics DHCP (Dynamic Host Configuration Protocol) for dynamic addressing .

.To be able to send and receive information on the network. must have some address Address of each device must be unique and follow some standard format by which it is known to the other devices on the network Device address consists of two partsThe address of the network to which the device is connected Address of the device itself. each device connected.

. After a "handshake" between the two applications. The "full-duplex" communication will occupy the communication line between the two computers until it is closed by one of the two applications. If one application wants to communicate with another via TCP. UDP is very similar to TCP.TCP Uses a Fixed Connection TCP is for communication between applications. but simpler and less reliable. TCP will set up a "full-duplex" communication between the two applications. This request must be sent to an exact address. it sends a communication request.

Each side of a TCP connection has a socket which can be identified by the pair < IP_address. Two processes communicating over TCP form a logical connection that is uniquely identifiable by the two sockets involved. that is by the combination < local_IP_address. . port_number >.Two processes communicating via TCP sockets. remote_port>. local_port. remote_IP_address.

IP reduces the need for network lines. IP does not occupy the communication line between two computers. Each line can be used for communication between many different computers at the same time.IP is Connection-Less IP is for communication between computers. messages (or other data) are broken up into small independent "packets" and sent between computers via the Internet. IP is a "connection-less" communication protocol. With IP. . IP is responsible for "routing" each packet to the correct destination.

it arrives at an IP router. The IP router is responsible for "routing" the packet to the correct destination. The path the packet will follow might be different from other packets of the same communication. errors in the network. depending on traffic volume. The router is responsible for the right addressing. . or other parameters. directly or via another router.IP Routers When an IP packet is sent from a computer.

IP is responsible for sending the packets to the correct destination. IP takes care of the communication with other computers. . TCP takes care of the communication between your application software (i.TCP/IP TCP/IP is TCP and IP working together. your browser) and your network software. TCP is responsible for breaking data down into IP packets before they are sent. and for assembling the packets when they arrive.e.

168.20.com. like this: 192.168.50.IP Addresses Each computer must have an IP address before it can connect to the Internet.1.254. Each computer must have a unique IP address. The numbers are always between 0 and 255. IP addresses are normally written as four numbers separated by a period.sg An IP Address Contains 4 Numbers. This is an IP address: 192.50 This might be the same IP address: www. . Each IP packet must have an address before it can be sent to another computer.image. This might be the IP address of your machine: 117.178 TCP/IP uses four numbers to address a computer.236.

sg. DNS servers all over the world are updated with this information. . When a new domain name is registered together with a TCP/IP address.Domain Names A name is much easier to remember than a 12 digit number. Names used for TCP/IP addresses are called domain names. the name is translated to a number by a Domain Name Server (DNS). All over the world.image.com.com. like http://www. Example of domain name: image.sg When you address a web site. DNS servers are connected to the Internet. DNS servers are responsible for translating domain names into TCP/IP addresses.

and to eliminate duplicate segments. If the ACK is not received within a timeout interval. Reliability TCP assigns a sequence number to each byte transmitted. TCP transfers a contiguous stream of bytes. also indicates to the sender the number of bytes it can receive beyond the last received TCP segment. The receiving TCP uses the sequence numbers to rearrange the segments when they arrive out of order.TCP/IP Facilities TCP provides the following facilities to:   Stream Data Transfer From the application's viewpoint. TCP does this by grouping the bytes in TCP segments. which are passed to IP for transmission to the destination. the data is retransmitted. This is sent in the ACK in the form of the highest sequence number it can receive without problems. Flow Control The receiving TCP. without causing overrun and overflow in its internal buffers. when sending an ACK back to the sender. TCP itself decides how to segment the data and it may forward the data at its own convenience.   . and expects a positive acknowledgment (ACK) from the receiving TCP.

 Multiplexing To allow for many processes within a single host to use TCP communication facilities simultaneously. this forms a socket. sequence numbers and window sizes. Logical Connections The reliability and flow control mechanisms described above require that TCP initializes and maintains certain status information for each data stream. is called a logical connection. The combination of this status. Each connection is uniquely identified by the pair of sockets used by the sending and receiving processes    Full Duplex TCP provides for concurrent data streams in both directions. A pair of sockets uniquely identifies each connection. the TCP provides a set of addresses or ports within each host. Concatenated with the network and host addresses from the internet communication layer. . including sockets.

TCP HEADER .

The sequence number identifies the byte in the stream of data from the sending TCP to the receiving TCP that the first byte of data in this segment represents. These two fields plus the source and destination IP addresses. respectively. Its normal size is 20 bytes unless options are present. The figure shows the format of the TCP header.    . This field is valid only if the ACK flag is on.explained  TCP data is encapsulated in an IP datagram. Once a connection is established the Ack flag is always on. combine to uniquely identify each TCP connection. The Acknowledgement number field contains the next sequence number that the sender of the acknowledgement expects to receive.TCP HEADER. This is therefore the sequence number plus 1 of the last successfully received byte of data. The SrcPort and DstPort fields identify the source and destination ports.

The PUSH flag signifies that the sender invoked the push operation. the UrgPtr field indicates where the non-urgent data contained in this segment begins. The URG flag signifies that this segment contains urgent data. The ACK flag is set any time the Acknowledgement field is valid. Finally. PUSH. When this flag is set. . implying that the receiver should pay attention to it. URG. which indicates to the receiving side of TCP that it should notify the receiving process of this fact. RESET. This is required because the length of the options field is variable.explained   The header length gives the length of the header in 32-bit words. FIN.TCP HEADER. The 6-bit Flags field is used to relay control information between TCP peers. the RESET flag signifies that the receiver has become confused and so wants to abort the connection. and ACK. respectively. The SYN and FIN flags are used when establishing and terminating a TCP connection. The possible flags include SYN.

The data portion of the TCP segment is optional.   . and then verified by the receiver.TCP HEADER. The Option field is the maximum segment size option. It specifies the maximum sized segment the sender wants to receive.explained  The Checksum covers the TCP segment: the TCP header and the TCP data. This is a mandatory field that must be calculated by the sender. Each end of the connection normally specifies this option on the first segment exchanged. called the MSS.

Sign up to vote on this title
UsefulNot useful