Professional Documents
Culture Documents
When data are being transferred in a computer system there must be rules set up as to how the
transfer is going to be done. The set of rules that needs to be established to allow the transfer of
data to be carried out is known as a protocol. There are a number of protocols for e.g. http or
TCP/IP.
Typical rules would define:
the wire connecting the two parts of the system: errors would occur if one device had a
serial connection and the other was expecting a parallel connection
the bit rate used: if one device sent data at a particular bit rate and the other device was
set to receive at a different rate, the message would not be received correctly
the parity used: if one device used even parity and the other device used odd parity then
no correctly sent byte of information would ever be accepted.
When two devices need to communicate, the initial contact between them is a signal called the
handshake signal. This involves an exchange of data between the two devices to establish that
they are both ready for the communication to start and that they agree on the rules that are
going to be used for the communication.
Physical and logical parts of a protocol
The interface between two devices is the connection between them through which data can be
sent. The physical part includes the wires or other connection. The logical part includes the rules
agreed about the form of error checking used. There are many other rules to the logical parts of
the protocol, for instance:
how the data transfer can be synchronized so that data are not mixed up.
A protocol stack is a combination of protocols. Each layer of the stack specifies a different
protocol for handling a function or subsystem of the communication process. Each layer has its
own set of rules.. Figure 6.1 shows the OSI reference model and the rules associated with each
layer. The protocols define the rules for each layer in the OSI reference model.
Note: TCP/IP is actually a suite of protocols sometimes referred to as the Internet Protocol
Suite.
TCP/IP stack
The most common protocol on the internet is the Transmission Control Protocol/Internet
Protocol (TCP/IP). To send data over a TCP/IP network requires four steps or layers:
Layer
Description
Name
Transport
Splits the data into manageable chunks, adds port number information
Internet
Adds IP addresses stating where the data is from and where it is going
Link
Adds MAC address information to specify which hardware device the message
came from, and which hardware device the message is going to
Successive encapsulation (wrapping) of application data descending through the protocol stack
before transmission on the local network link
To show you how the TCP/IP stack works we going to use the following data as an example:
Data
:60 | 1/4
<gospel>Matt</gospel>
:60 | 2/4
<gospel>Mark</gospel>
:60 | 3/4
<gospel>Luke</gospel>
:60 | 4/4
<gospel>John</gospel>
Network/Internet
The network layer attaches the IP address of the sender, so that the recipient will know who
sent it and who to send a confirmation message to. It must also attach the IP address of the
host that it is sending the data to so it doesn't get lost! In this case we are sending to
102.231.4.189 and sending from 98.1.232.99. Combined with the port number this creates
asocket that data is being sent from and a socket that data is being sent to,
namely 102.231.4.189:60
102.231.4.189
98.1.232.99
102.231.4.189
98.1.232.99
102.231.4.189
98.1.232.99
102.231.4.189
98.1.232.99
Transport Header
Data
:60 | 1/4
<gospel>Matt</gospel>
:60 | 2/4
<gospel>Mark</gospel>
:60 | 3/4
<gospel>Luke</gospel>
:60 | 4/4
<gospel>John</gospel>
Link
Finally the link layer attaches the MAC address of the sender and the recipient, allowing the
packets to be directed to a specific network interface on the IP Address host machine. In this
case the sender is using a wireless card with MAC address: 00-17-4F-08-5D-69 and the
destination MAC address is: 11-22-33-44-55
Network Header
11-22-33-44-55
102.231.4.189
00-17-4F-08-5D-69
98.1.232.99
11-22-33-44-55
102.231.4.189
00-17-4F-08-5D-69
98.1.232.99
11-22-33-44-55
102.231.4.189
00-17-4F-08-5D-69
98.1.232.99
11-22-33-44-55
102.231.4.189
00-17-4F-08-5D-69
98.1.232.99
Transport Header
Data
:60 | 1/4
<gospel>Matt</gospel>
:60 | 2/4
<gospel>Mark</gospel>
:60 | 3/4
<gospel>Luke</gospel>
:60 | 4/4
<gospel>John</gospel>
These four packets can then be sent across the internet holding enough information for them to:
1. reach their destination (socket from the Network and Transport Layers)
2. find the correct network interface (MAC address from the Link Layer)
3. find the correct service(Port number from the Transport Layer)
4. be reassembled in the correct order (Order information from the Transport Layer)
5. deliver the intended message (data from the Application Layer)
Bittorrent (BT) is a peer-to-peer (P2P) file transfer protocol, used for sharing large files
over the Internet.
To send or receive files the user must have a BitTorrent client (a computer program that
implements the BitTorrent protocol). Some popular BitTorrent clients include Xunlei,
Transmission, Torrent, MediaGet, Vuze and BitComet. BitTorrent trackers provide a list
of files available for transfer, and assist in transferring and reconstructing the files. The
best-known BitTorrent tracker is The Pirate Bay.
Port number
21
25
80 & 8080
110
143
443
666
989
23
Telnet
Non-secure protocols
Several of the protocols used to transmit data across networks (including the internet) are not
secure. This means that if you are one of the routers that is used to get data from one host to
another, you can read the data being sent, this technique is called packet sniffing. Normally this
isn't a problem as the data being transmitted isn't secret but reading other people's packets
without their permission is a crime in the UK.
FTP
File Transfer Protocol (FTP) is a standard network protocol used to copy a file from one host to
another over a TCP/IP-based network, such as the Internet. FTP is built on a client-server
architecture. FTP users may authenticate themselves using a clear-text (unencrypted) sign-in
protocol but can connect anonymously if the server is configured to allow it. FTP works on port
21.
An HTTP request made using telnet. The request, response headers and response body are
highlighted.
Telnet
Telnet is a network protocol used on the Internet or a local area network to provide text-oriented
communications between a server and remote clients. A client will connect to the server using a
terminal (black and white command line console) and can then deliver commands to the server
to perform things like remote software installation or system updates. Telnet works on several
different ports.
POP3, SMTP
Simple Mail Transfer Protocol (SMTP) is an Internet standard for sending electronic mail (email) across Internet Protocol (IP) networks. SMTP is specified for outgoing mail transport and
uses TCP port 25. The protocol for receiving mail is called the Post Office Protocol 3 and it uses
port 110.