CS50 TCP (Transmission Control Protocol)


Transmission Control Protocol (TCP)

If the internet Protocol (IP) is thought of as the protocol for getting information
from a sending machine to a receiving machine, then Transmission Control Protocol (TCP) can be
thought of as directing the transmitted packet to the correct program on the receiving machine.

As you might imagine, it is important to be able to identify
both where the receiver si and what the packet is for, so TCP
and IP are almost an inseparable pair: TCP/IP.

Each program/utility/service on a machine is assigned a port
number. Coupled with an IP address, we can now uniquely
identify a specific program on a specific machine.

The other thing that TCP is crucial for is guaranteeing delivery
of packets, which IP alone does not do.

TCP does this by including information about how many
packets the receiver should expect to get, and what order,
and transmitting that information alongside the data.

Steps of the TCP/IP process

  1. When a program goes to send data, TCP breaks it into smaller
    chunks and communicates those packets to the computer's
    network software, adding a TCP layer onto the packet.

  2. IP routes the individual packets from sender to receiver;
    this info is part of the IP layer surrounding the packet.

  3. When the destination computer gets the packet, TCP looks at the
    header to see thich program it belongs to; and since the routes
    packets take may differ, TCP also must present those packets to the
    destination program in the proper order.

If at any point along the way a router delivering information
using the Internet Protocol dropped a packet, TCP would use
additional information inside the headers to request that the
sender pass along the extra packet so it could complete assembly.

After the packets have arrived, TCP ensures they are organized
the correct order and can then be reassembled into the
intended unit of data and delivered to the correct service.

#cs50 #TCP






你可能感興趣的文章

AI輔導室|製作上平下凹的拱形效果

AI輔導室|製作上平下凹的拱形效果

SlowHTTPTest筆記-2

SlowHTTPTest筆記-2

以UI較度切入響應式網站

以UI較度切入響應式網站






留言討論