Computer Science
TCP/IP Protocol

Definitions

  • Server - a software process that provides a service requested by a client
  • Client - a software process that requests and uses services from a server
  • Client-server model - a client software process initiates a request for a service from a server software process, and the server responds to that request

Protocols

A protocol, is a set of rules required for successful communication between devices. The protocol defines the signals, codes and rules for transmission of data across the network. Standard protocols conform to standards laid down by a standards authority. This makes communication possible between devices which support the standard.

Network Protocol Stacks

Networking protocols are usually designed in layers, with each layer responsible for a different part of the communication process. The collection of layers that make up the protocol is called the protocol stack.

The Open Systems Interconnect Model

In 1978, the International Standards Organization (ISO) introduced a model for Open Systems Interconnect (OSI) as a first step toward international standardization of the various protocols required for network communication.

The model consists of seven layers, each layer representing a specific set of network functions.

1. Physical Layer

The physical layer is the lowest layer of the OSI model. This layer controls the way unstructured, raw, bit-stream data is sent and received over a physical medium. This layer describes the electrical or optical, mechanical, and functional interfaces to the physical network medium. The physical layer carries the signals for all of the higher layers.

2. Data-link Layer

The data-link layer provides error-free transfer of data frames from one computer to another over the physical layer. It concerns itself with error-checking and data flow control. The layers above this layer can assume virtually error-free transmission over the network.

3. Network Layer

The network layer determines which physical path the data takes, based on the network conditions, the priority of service, and other factors.

4. Transport Layer

The transport layer makes sure that messages are delivered in the order in which they were sent and that there is no loss or duplication.

5. Session Layer

The session layer establishes a communications session between processes running on different computers.

6. Presentation Layer

The presentation layer serves as the data translator for the network. This layer on the sending computer translates data from the format sent by the application layer into a common format. At the receiving computer, the presentation layer translates the common format to a format known to the application layer.

7. Application Layer

The application layer serves as the window for users and application processes to access network services.

TCP/IP

Transport Control Protocol (TCP) and Internet Protocol is used on the Internet. The protocol stack is normally considered to be a four-layer protocol. The layers of the stack are,

  • Application
  • Transport
  • Network (Internet)
  • Link

Link Layer

The link layer is responsible for placing TCP/IP packets on the network medium and receiving TCP/IP packets off the network medium. The link layer uses hardware addresses (MAC addresses). It is not the part of the protocol that deals with whether or not packets arrive or how they are sequenced.

Network Layer

The Internet layer is responsible for addressing, packaging, and routing functions.

Transport Layer

TCP is responsible for

  • the establishment of a TCP connection,
  • the sequencing and acknowledgment of packets sent,
  • and the recovery of packets lost during transmission.

TCP Ports

A port is an element added to an address to identify which process to pass data to on the host machine.

Port numbers are allocated to client application connections by the TCP program to allow the server to keep track of the connections.

Sockets

Combining the host IP address and port number gives you the socket. It is an identifier for a particular service on a particular node on a network. There are two kinds, streams (bidirectional) and datagrams.

Client port numbers are allocated incrementally in the range 1024 to 4095.

Servers use universally known port numbers to allow clients to access services more easily.

PortServer
20FTP server, file transfer data
21FTP server, file transfer control
80 & 8080Web server
25SMTP Server
100POP3 Server
23Telnet Server

Application Layer

The Application layer provides applications the ability to access the services of the other layers and defines the protocols that applications use to exchange data. There are many Application layer protocols and new protocols are always being developed.

Application Layer Protocols

The Hypertext Transfer Protocol (HTTP) is used to transfer files that make up the Web pages of the World Wide Web.

The File Transfer Protocol (FTP) is used for interactive file transfer.

The Simple Mail Transfer Protocol (SMTP) is used for the transfer of mail messages and attachments.

Telnet, a terminal emulation protocol, is used for logging on remotely to network hosts.

Hypertext Transfer Protocol

A client machine sends a request to a server. The server responds with data (text formatted as HTML, images, audio). TCP establishes the connection for the HTTP to send and receive messages between client and server.

When you request a page from your browser, it,

  • Accepts URI from user
  • Extracts FQDN and uses DNS server to translate to IP address
  • Sends a GET request for the resource specified (port 80 by default)
  • Receives the file returned
  • Renders the file on screen
  • Repeat the process for any other URIs in the document (style/images/audio etc)

File Transfer Protocol

This is the protocol you use to copy files from client to server and server to client. Some FTP servers restrict access. Some require that anonymous be entered as the user name and an email address as the password.

Telnet

Text-based protocol to manage a remote machine. You can send and receive e-mail, read the HTML text of a web page and enter text commands. There is a free client shipped with Windows and many open source options are out there.

POP3 & SMTP

POP3 is for retrieving stored mail. SMTP is for sending the mail

HTTPS

Secure Sockets Layer is a protocol that sits beneath the HTTP application layer. It uses port 443 instead of port 80 and is widely used when security is required. For example,

  • Financial transactions
  • Logging into company networks remotely
  • Personal information