TCP/IP Flashcards
What is TCP/IP?
TCP/IP is the communication protocol for communication between computers on the Internet.
TCP/IP stands for Transmission Control Protocol / Internet Protocol.
TCP/IP defines how electronic devices (like computers) should be connected to the Internet, and how data should be transmitted between them.
What is inside TCP/IP?
Inside the TCP/IP standard there are several protocols for handling data communication:
TCP (Transmission Control Protocol) communication between applications
UDP (User Datagram Protocol) simple communication between applications
IP (Internet Protocol) communication between computers
ICMP (Internet Control Message Protocol) for errors and statistics
DHCP (Dynamic Host Configuration Protocol) for dynamic addressing
How is TCP communication used?
TCP is for communication between applications. If one application wants to communicate with another via TCP, it sends a communication request. This request must be sent to an exact address. After a “handshake” between the two applications, TCP will set up a “full-duplex” communication 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.
UDP is very similar to TCP, but simpler and less reliable.
What is IP?
IP is Connection-Less
IP is for communication between computers.
IP is a “connection-less” communication protocol.
IP does not occupy the communication line between two computers. IP reduces the need for network lines. Each line can be used for communication between many different computers at the same time.
With IP, messages (or other data) are broken up into small independent “packets” and sent between computers via the Internet.
IP is responsible for “routing” each packet to the correct destination.
IP is Connection-Less
IP is for communication between computers.
IP is a “connection-less” communication protocol.
IP does not occupy the communication line between two computers. IP reduces the need for network lines. Each line can be used for communication between many different computers at the same time.
With IP, messages (or other data) are broken up into small independent “packets” and sent between computers via the Internet.
IP is responsible for “routing” each packet to the correct destination.
IP is Connection-Less
IP is for communication between computers.
IP is a “connection-less” communication protocol.
IP does not occupy the communication line between two computers. IP reduces the need for network lines. Each line can be used for communication between many different computers at the same time.
With IP, messages (or other data) are broken up into small independent “packets” and sent between computers via the Internet.
IP is responsible for “routing” each packet to the correct destination.
IP is for communication between computers.
IP is a “connection-less” communication protocol.
IP does not occupy the communication line between two computers. IP reduces the need for network lines. Each line can be used for communication between many different computers at the same time.
With IP, messages (or other data) are broken up into small independent “packets” and sent between computers via the Internet.
IP is responsible for “routing” each packet to the correct destination.
TCP vs UDP Function
TCP: As a message makes its way across the internet from one computer to another. This is connection based.
UDP: UDP is also a protocol used in message transport or transfer. This is not connection based which means that one program can send a load of packets to another and that would be the end of the relationship. Stateless.
TCP vs UDP Usage
TCP: TCP is used in case of non-time critical applications.
UDP: UDP is used for games or applications that require fast transmission of data. UDP’s stateless nature is also useful for servers that answer small queries from huge numbers of clients.
TCP vs UDP: Examples
TCP: HTTP, HTTPs, FTP, SMTP, Telnet…
UD: DNS, DHCP, TFTP, SNMP, RIP VOIP
Ordering of data packets:
TCP rearranges data packets in the order specified.
UDP has no inherent order as all packets are independent of each other. If ordering is required, it has to be managed by the application layer.
Header Size
TCP header size is 20 bytes
UDP Header size is 8 bytes.
Common Header Fields:
TCP: Source port, Destination port, Check Sum
UDP: Source port, Destination port, Check Sum
Streaming of data:
TCP: Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries.
UDP: Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent.
Weight:
TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.
UDP is lightweight. There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP.
Data Flow Control:
TCP does Flow Control. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.
UDP does not have an option for flow control
Error Checking:
TCP does error checking
UDP does error checking, but no recovery options
Fields:
- Sequence Number, 2. AcK number, 3. Data offset, 4. Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer 8. Options, 9. Padding, 10. Check Sum, 11. Source port, 12. Destination port
UDP: 1. Length, 2. Source port, 3. Destination port, 4. Check Sum