Y12 Unit 0 - Class Structure
Y12 Unit 1 - Computational Thinking
Y12 Unit 2 - Networks
Y12 Unit 3 - OOP
Y12 Unit 4 - System Fundamentals
Abstract Data Structures (HL) Year 13 Unit

Transmission of Data Through Networks

IB Standards Covered:

3.1.2 Outline the importance of standards in the construction of networks
3.1.3 Describe how communication over networks is broken down into different layers
3.1.6 Define protocol and data packet
3.1.7 Explain why protocols are necessary
3.1.8 Explain why the speed of data transmission across a network can vary
3.1.9 Explain why compression of data is often necessary when transmitting across a network
3.1.10 Outline characteristics of different transmission media
3.1.11 Describe how data is transmitted by packet switching

For computer systems to be able to communicate with each other there needs to be a common, agreed-upon, language that all systems should expect and understand. In networking, this is called a protocol. With a protocol in place, the following steps are necessary for the transmission of data:

  1. Systems must connect to the network through an address and/or port
  2. Data is encoded by the client or the server in the protocol’s format.
  3. Data is broken up into small groups called packets. Each packet should also contain information about the sender and the destination.
  4. Packets travel through the network, either wirelessly or through cables, to their destination.
  5. Switches/routers make sure the data is sent to the correct destination.
  6. The destination application receives the data and decodes it into the desired form. The packets will contain binary data and the destination should be able to convert it into strings, objects or primitive types.

Standards

A standard is a formalized protocol. A set of widely used and agreed formats through which systems can communicate. You can think of a standard as the set of rules of English language grammar. A protocol would then be different dialects used by different members of a system, like British English vs. American English.

The most widely used networking standard is the Open Systems Interconnection model (OSI). The OSI Model was established to facilitate communication across systems. and it contains seven layers.

LayerDescription and Protocols used
(1) ApplicationPerforms various services for the applications
used by the end-users.
(2) PresentationProvide data format information, data compression
information and data encryption information to the application.
(3) SessionManage sessions between two users
(4) TransportEncode, packet, transmit, decode.
(5) NetworkHandle routing of packers through an intermediary device.
(6) Data LinkError handling of physical transmission.
(7) PhysicalTransmit bits of media between devices, define
voltage levels and media specs.

Importance of Network Protocols

Protocols are important because they provide:

1. Rules about the message format
2. Rules about the way intermediary devices should facilitate communication
3. Rules about initiation and termination of a communication session
4. Rules about the type of error checking to be used
5. Rules about the data compression methods and algorithms (if compression takes place)
6. Rules about an error detection and correction mechanism Rules about recovery and resending of data

TCP/IP

A network protocol must adhere to the standard above. In our problem set, we will be using the TCP/IP protocol, which is widely used in modern internet connections. TCP/IP (Transfer Control Protocol / Internet Protocol) describes all of the functions that take place at each layer within the TCP/IP suite. To adhere to the OSI standard, TCP/IP follows the following abstraction layers:

LayerTCP/IP Description
(1) Network AccessThe use of devices like routers, switches,
Ethernet cables and network cards that are
compatible with TCP/IP.
(2) InternetControls the routing of packets using
addresses called Internet Protocol
Address, of IP Address.
(3) TransportEncode, packet, transmit, decode using TCP
formats. Packets are used to ensure that
losing one packet will not affect the rest of
the data. Only one packet needs to be
re-transmitted.
(4) ApplicationHyperText Transfer Protocol is used to
provide services for the software applications

Data Transmission Speed

Compression

There are a variety of factors that will affect the speed of data transmission over a network. The main factor that we as developers can control is the size/amount of data that we are transmitting. Unfortunately, networks have limited bandwidth. Using compression helps increase the speed of a transfer. There are two types of data compression:

1. Lossy data compression – Creates much smaller files by removing some data that is not noticeable to the human eye. Some examples are JPEG and MPEG2.
2. Lossless data compression – Reduces file size but maintains all original information. The final file size is bigger (less compression) with lossless over lossy. Some examples are LZ77 and ZIP.

Different Transmission Media

There are also infrastructured-based factors outside of our control that will affect data transmission speeds. Cables, routers, transmission technology will have a huge effect on our network’s performance.

Wired Communication
1. Copper cables: the most common cables in computer networks.
2. Unshielded Twisted Pair Cables: Low cost and very popular with LANs, they have high transfer rates but used in short distances.
3. Fiber Optic Cables: Offers the highest speed at long distances but they are very expensive.

Wireless Communication
1. Microwave Radio: Mostly used in LANs where no barriers exist between clients and servers.
2. Infrared: Used only in short distances but they are very secure.
3. RFID: Mostly used for payments, a very short distance between client and distance is necessary.
4. Bluetooth: Transmit using a small amount of power and have moderate transmission rates.

Packet Switching

socket is nothing more than a convenient abstraction. It represents a connection point into a TCP/IP network, much like the electrical sockets in your home provide a connection point for your appliances. When two computers want to converse, each uses a socket. One computer is termed the server-it opens a socket and listens for connections. The other computer is termed the client-it calls the server socket to start the connection. To establish a connection, all that’s needed is a server’s destination address and port number.

Each computer in a TCP/IP network has a unique address. Ports represent individual connections within that address. This is analogous to corporate mail-each person within a company shares the same address, but a letter is routed within the company by the person’s name. Each port within a computer shares the same address, but data is routed within each computer by the port number. When a socket is created, it must be associated with a specific port-this process is known as binding to a port. In our problem set, we will be using TCP connections but it is important to note that some applications use a different kind of connection known as UPD/Connectionless.

Sockets have two major modes of operation: connection-oriented and connectionless modes. Connection-oriented sockets operate like a telephone: they must establish a connection and then hang up. Everything that flows between these two events arrives in the same order it was sent. Connectionless sockets operate like the mail: delivery is not guaranteed, and multiple pieces of mail may arrive in a different order than they were sent.

The mode you use is determined by an application’s needs. If reliability is important, a connection-oriented operation is better. File servers must have all their data arrive correctly and in sequence. If some data is lost, the server’s usefulness is invalidated. Some applications-time servers, for example-send discrete chunks of data at regular intervals. If data were to get lost, the server would not want the network to retry because by the time the resent data arrived, it would be too old to have any accuracy. When you need reliability, be aware that it does come with a price. Ensuring data sequence and correctness requires extra processing and memory usage; this extra overhead can slow down the response times of a server.


A connectionless operation, also known as Packet Switching, uses the User Datagram Protocol (UDP). A datagram is a self-contained unit that has all the information needed to attempt its delivery. Think of it as an envelope-it has a destination and return address on the outside and contains the data to be sent on the inside. A socket in this mode does not have to connect to a destination socket; it simply sends the datagram. The UDP protocol promises only to make a best-effort delivery attempt. Connectionless operation is fast and efficient, but not guaranteed.


A connection-oriented operation uses the Transport Control Protocol (TCP). A socket in this mode must connect to the destination before sending data. Once connected, the sockets are accessed using a streams interface: open-read-write-close. Everything sent by one socket is received by the other end of the connection in exactly the same order it was sent. Connection-oriented operation is less efficient than connectionless operation, but it’s guaranteed.