Ch. 14 Communication and internet technologies
14.1 Protocols
The need for protocols
When sending and receiving data, both parties need to agree the protocol being used to ensure successful communication takes place.
Internet protocol suite
The 4 layer structure for internet protocol suite looks like:
- Application layer
- Transport layer
- Network layer
- Data link layer
where sending goes from the application layer to the link layer, and receiving goes from the link layer to the application layer.
Application layer
- Contains all the programs that exchange data, such as web browsers or server software
- It sends files to the transport layer
- Allows applications to access the services used in other layers
- Defines the protocols that any app uses to allow the exchange of data
- HTTP (Hypertext transfer protocol)
- Used when fetching an HTML document from a web server
- Defines the format of the messages sent and received
- Web browser initiates the web page request and also converts HTML into a format which can be displayed on the user’s screen
- FTP (File transfer protocol)
- Used when transferring files from one computer/device to another via the internet or other networks
- POP3 (Post office protocol)
- Used when receiving emails from the email server
- A pull protocol
- Does not keep the server and client in synchronisation
- When emails are downloaded by the client, they are then deleted by the server
- IMAP (Internet message access protocol)
- Used when receiving emails from the email server
- A pull protocol
- Keeps the server and client in synchronisation
- Only a copy of the email is downloaded with the original remaining on the server
- SMTP (Simple mail transfer protocol)
- Used when sending emails
- A push protocol
- Client opens a connection to a server and keeps the connection at all times
- Client uploads a new email to the server
- BitTorrent protocol
- Computers share files directly with each other
- No structure and no controlling mechanism
- Peers act as both clients and servers
- Each peer is just one end-system
- When a peer acts as a server, it is called a “seed”
- How does a peer find others that have the wanted content?
- Every content provider provides a content description, which is a file that contains the name of the tracker and a list of the chunks that make up the content
- The tracker is a server that maintains a list of all the other peers (the “swarm”) actively downloading and uploading the content
- How do peers replicate content to provide high-speed downloads for everyone?
- Peers download and upload chunks at the same time, but peers have to exchange lists of chunks and aim to download rare chunks for preference
- Each time a rare chunk is downloaded it automatically becomes less rare
- How do peers encourage other peers to provide content rather than just using the protocol to download for themselves?
- Requires dealing with “leechers” who only download
- Randomly try other peers but then to only continue to upload to those peers that provide regular downloads
- If a peer is not downloading or only downloading slowly, the peer will eventually be isolated
Transport layer
- Regulates the network connections
- Where data is broken up into packets which are then sent to the network layer
- Ensures that packets arrive in sequence without errors, by swapping acknowledgements and retransmitting packets if they become lost or corrupted
TCP (Transmission control protocol)
- Responsible for the safe delivery of a message by creating sufficient packets for transmission
- Automatically resends a data packet if it has not received a positive acknowledgement
- Connection-oriented since it establishes an end-to-end connection between two host computers using handshakes
Network layer
- Network layer identifies the intended network and host
- Common protocol is IP
IP (Internet protocol)
- Ensure correct routing of packets of data over the network
- Responsible for protocols when communicating between networks
- Take a packet from the transport layer and add its own header which will include the IP addresses of both sender and recipient
- The IP packet is sent to the data link layer where it gets assembled into frames for transmission
Data link layer
- Identifies and moves traffic across local segments
- Encapsulates IP packets into frames for transmission
- Maps IP addresses to MAC addresses and ensures correct protocols are followed
- Identifies network protocols in the packet header and delivers packets to the network
- Ethernet protocols
- Designed for use in a local area network
- Connects a number of computers or devices together to form a LAN
- Uses protocols to control the movement of frames between computers or devices and to avoid simultaneous transmission by two or more devices
- A local protocol, does not communicate with external devices
14.2 Circuit switching and packet switching
Circuit switching
- Method used in the traditional telephone system
- End-systems connected to local exchanges which have a switching function and which are connected via a number of intermediate nodes with a switching function
- For a data transfer to take place, the following has to happen:
- The sender provides the identity of the intended receiver
- The system checks whether or not the receiver is ready to accept data
- If the receiver is available, a sequence of links is established across the network
- The data is transferred
- The links are removed
- Pros:
- Circuit is dedicated to the single transmission only
- Whole of the bandwidth is available
- The data transfer rate is faster than with packet switching
- Packets arrive in the same order as they were sent
- Data will not get lost since all packets follow the same route
- Works better than packet switching in real time applications
- Cons:
- Not very flexible (has to use a single line)
- Nobody can use the circuit even when it is idle
- Circuit is always there whether or not it is used
- If there is a failure, no alternate routing available
- Dedicated channels require a greater bandwidth
- Time to establish a link can be long
Packet switching
- Allows data transmission without a circuit being established
- Shortest path available is selected
- Data cannot be sent in a continuous stream, and they arrive the destination in a different order
- Data is packaged in portions inside packets
- A packet consists of a header which contains instructions for delivery plus the data body
- Pros:
- No need to tie up a communication line
- Possible to overcome faulty lines by rerouting
- Easy to expand traffic usage
- Charges user on the distance instead of the duration
- High data transmission is possible
- Uses digital networks which means digital data is transmitted directly to the destination
- Cons:
- The protocols can be more complex
- If a packet is lost, the sender must resend the packet
- Does not work well with real-time data streams
- The circuit has to share its bandwidth with other packets
- There is a delay at the destination while packets are reassembled
- Needs large amounts of RAM to handle the large amounts of data