Reading 16 - morgan-401-advanced-javascript/seattle-javascript-401n14 GitHub Wiki

Read

TCP Explained

Link

What TCP Does

The function of TCP is to control the transfer of data such that it is reliable. On networks like the Internet, data is transmitted in packets, which are units of data that are sent independently on the network, and are reassembled once they reach the destination to give back the original data.

How TCP Works

TCP labels its packets such that they are numbered. It also makes sure they have a deadline to reach the destination (which is a duration of several hundred milliseconds called time-out) and some other technical provisions. For each packet received, the sending device is notified through a packet called acknowledgment. The name says it all. If after the time-out, no acknowledgment is received, the source sends another copy of the probably missing or delayed packet. Out-of-order packets are also not acknowledged. This way, all packets are always assembled in order, without holes and within a predetermined and acceptable delay.

TCP Addressing

While IP has a complete mechanism for addressing known as IP addresses, TCP has no such elaborate addressing system. It does not need one. It only uses numbers provided by the device it is working on to identify where it is receiving and sending packets for which service. These numbers are called ports. For example, web browsers use the port 80 for TCP. Port 25 is used or email. The port number is often coupled with the IP address for a service, e.g. 192.168.66.5:80

What is TCP

Link

  • TCP (Transmission Control Protocol) is a standard that defines how to establish and maintain a network conversation via which application programs can exchange data. TCP works with the Internet Protocol (IP), which defines how computers send packets of data to each other. Together, TCP and IP are the basic rules defining the Internet. TCP is defined by the Internet Engineering Task Force (IETF) in the Request for Comment (RFC) standards document number 793.

  • TCP is a connection-oriented protocol, which means a connection is established and maintained until the application programs at each end have finished exchanging messages. It determines how to break application data into packets that networks can deliver, sends packets to and accepts packets from the network layer, manages flow control, and—because it is meant to provide error-free data transmission—handles retransmission of dropped or garbled packets as well as acknowledgement of all packets that arrive. In the Open Systems Interconnection (OSI) communication model, TCP covers parts of Layer 4, the Transport Layer, and parts of Layer 5, the Session Layer.

Vocab

Protocol

Set of rules to do something

HTTP

HyperText Transfer Protocol - set of rules and standards for transferring data on the web

Skim

Build a TCP Server (code only)

Link

Watch

Windows users only: Please watch this video to install a tool called Putty that you will need to prepare for Lab 16.

Bookmark

Node docs: net module

Link