Overview

Network Components

  • Hosts: Clients and Servers
  • Router
  • Network protocols

Information Switching Methods

Circuit Switching

In circuit switching, a fixed, specialized physical communication path is established between the two communicating
parties. This path is maintained for the duration of the call until the end of the call. Data is transmitted
sequentially along this path.

Primarily used for real-time communications

Features

  • Ensures continuity: With a specialized communication path between the communicating parties, data transmission is
    continuous and real-time and is suitable for real-time communication.

  • Inefficient : During communication, the communication path remains occupied even when no data is being transmitted.

  • Longer call setup times : Before a call can be established, a physical path needs to be allocated to the communicating
    parties.

Packet Switching

Packet switching is the main communication method used in modern computer networks, such as the Internet. In packet
switching, data is cut up into packets, each of which is transmitted independently. The packets are reassembled into the
original data at their destination by choosing the appropriate path through the network based on the best route.

Widely used in modern computer networks

Features

  • Efficient : packets are transmitted independently in the network and the best path can be selected dynamically based
    on network congestion. This allows for more efficient resource utilisation and faster data transfer rates.
  • Resilient: Packet-switched networks are highly resistant to interference and fault-tolerant for the reason that
    packets can be transmitted over different paths.
  • Suitable for a wide range of applications : Packet switching can handle many types of data and is well suited to
    complex computer network applications.

Network Protocol

A set of regulations that implement various functions in a computer network, which describe how data is transmitted, formatted and processed in the network.

IP (Internet Protocol)

  • The primary protocol at the network layer
  • Handle network addressing and the transmission of packets across the network.
  • IP uses 32-bit (IPv4) or 128-bit (IPv6) addresses to uniquely identify each device on the network.
  • IP provides interoperability between different types of networks and devices.

ICMP (Internet Control Message Protocol)

  • ICMP is a secondary protocol to the IP protocol that is used to transmit control and error messages across a network.
  • Applications for ICMP include network troubleshooting (e.g. ping commands) and communication between routers.

ARP (Address Resolution Protocol)

  • ARP is a data link layer protocol used to map IP addresses at the network layer to physical addresses at the data link layer
  • ARP allows IP packets to be correctly transmitted to the destination device on the local network.

TCP (Transmission Control Protocol)

  • The main protocol of the transport layer and provides connection-oriented and reliable data transfer services.
  • Establishe a connection through a handshake process
  • Use sequence numbers and acknowledgement mechanisms to ensure reliable data transfer and a sliding window mechanism for flow control.

UDP (User Datagram Protocol)

  • Also a transport layer protocol, but unlike TCP, it provides a connectionless, unreliable data transfer service
  • Pros : a low transmission overhead, suitable for applications that require high real-time performance and allow for packet loss, such as real-time voice and video communications.

DNS (Domain Name System)

  • An application layer protocol for resolving human-readable domain names into IP addresses.
  • Enable users to access websites and web services via domain names without having to remember complex IP addresses.

HTTP (Hypertext Transfer Protocol)

  • An application layer protocol used to transfer hypertext and other resources between a client (e.g. a browser) and a server.
  • The most commonly used protocol on the Internet and forms the basis of the World Wide Web (WWW).

FTP (File Transfer Protocol)

  • An application layer protocol used to transfer files between a client and a server.
  • Support the upload, download, deletion and renaming of files and provides control over file access rights
  • Commonly used to share files between users and servers and to manage website content

SMTP (Simple Mail Transfer Protocol)

  • An application layer protocol used to send emails between mail servers or from clients to mail servers. (Internet Message Access Protocol).

DHCP (Dynamic Host Configuration Protocol)

  • An application layer protocol used to dynamically assign IP addresses and other network configuration information to devices on a network.
  • Allow network administrators to centrally manage IP address assignments, simplifying network configuration and administration.

SSL/TLS (Secure Sockets Layer/Transport Layer Security)

  • SSL and TLS are application-layer encryption protocols used to establish a secure communication channel between clients and servers.
  • Protect the integrity and privacy of data from eavesdropping and tampering. They are widely used in security-sensitive scenarios, such as online payments, login authentication, etc.

Header and Payload

In computer networks, data is usually encapsulated and transmitted according to a protocol format. A data packet or frame is usually divided into two parts: the Header and the Payload. The header and the payload have different roles to play in the transmission and processing of data in the network.

Header: The header is the beginning of the packet or frame and contains the control information used to process and transmit the data.

  • Source and destination address: The header usually contains address information for the sender and receiver.
  • Protocol type: The header also contains information about the protocol type to identify which protocol the packet belongs to.
  • Sequence number and acknowledgement number: For connection-oriented protocols (e.g. TCP), the sequence number and acknowledgement number are also included in the header for reliable data transfer and traffic control.
  • Checksum: Checksum information is usually included in the header and is used to detect if data errors occur during transmission.
  • Other control information: The header may also contain other control information such as the packet’s lifecycle, priority, flag bits.

Payload: The payload is the main part of the packet or frame and contains the actual data to be transmitted. The content of the payload varies depending on the application and scenario.

  • During data transmission, packets or frames pass through several network layers.
  • Encapsulation : Each layer may add its own header to the data, creating a nested structure.
  • De-encapsulation : When the data reaches its destination, each network level in turn removes the appropriate headers and restores the original data.

Computer Network Classification

Classified by Areas

LAN

Local Area Network, refers to a system where computers and other devices within a relatively small geographical area
are connected to each other through the medium of a network. The primary purpose of a local network is to enable
resource sharing, data transfer and communication between devices.

Features

  1. Limited range: Usually covers a small geographical area
  2. High-speed transmission: Data transfer speeds within a local network are typically faster than in a wide area
    network (WAN).
  3. Privately owned: Owned and managed by organisations or individuals.
  4. Variety of devices: May include a variety of devices
  5. Communication protocols: Typically use Ethernet or Wi-Fi as the communication protocol.

Benefits

  1. easy sharing of resources and collaboration between devices
  2. reduced communication costs

MAN

Metropolitan Area Network, a regional network covers a city or group of cities

Size : Between LAN and WAN

Application scenarios : connecting multiple office buildings, university campuses, government agencies, etc. within the
same city.

Use high-speed fibre or other high-speed transmission media, which can provide high data transfer rates.

CAN

Campus Area Network, covers the area of a school, university or corporate campus.

Size : Between LAN and MAN

Usually consists of multiple interconnected LANs for resource sharing, communication and data transfer.

WAN

Wide Area Network , covers a large geographical area, such as a country, region or even the world.

WANs connect multiple local networks, regional networks and metropolitan networks through remote communication links and
relay devices.

Application scenarios : The Internet, telephone companies’ networks and global networks of large enterprises.

Have lower data transfer rates because of spanning greater distances and involving more relay equipment.

Classified by Network Typology

bus

ring

apply tokens to communicate

star

The central node is under high pressure

mesh

Network Equipment

Switch

Primarily for forwarding packets between devices within the same LAN,
MAC

Router

Primarily for forwarding packets between different networks
IP

Network Model

OSI(Open System Interconnect)

Physical Layer

  • Establish, maintain and terminate physical connections, and provide means for the transmission of synchronization and
    bit streams on physical media.
  • Responsible for handling communication tasks related to physical media, such as cables and fiber optics
  • Include the transmission of data as bit streams, signal encoding, and hardware interfaces
  • Data is transmitted at the bit level in this layer.
    Devices: Network interface cards (NIC), Ethernet cables, hubs, repeaters, modems

Data Link Layer

  • Establish logical connections, performs hardware address (MAC address) addressing
  • Combine bits into bytes and frames, and access the media using MAC addresses
  • Perform error detection and flow control
  • Detect errors but cannot correct them
  • Data is transmitted in frames at this layer
    Devices: Bridges, switches.

Network Layer

  • Perform logical address (IP address) addressing and implement path selection between different networks.
  • IP addresses are used for addressing at the Network Layer
  • Handle packet fragmentation and reassembly
  • Data is transmitted in packets at this layer
    Protocols : ICMP, IGMP, IP (IPv4, IPv6), ARP, RARP.
    Devices: Routers.

Transport Layer

  • Define protocols and port numbers for transmitting data, and provide flow control and error checking
  • Provide end-to-end communication services, including segmentation, transmission, reassembly, and acknowledgement of
    data
  • Handles flow control and error control
    Protocols : TCP(Transmission Control Protocol), UDP(User Datagram Protocol)

Session Layer

  • Establish, manage, and terminate sessions.
  • Corresponds to the processes on the host, referring to the ongoing sessions between local and remote hosts.
  • Communication sessions are differentiated using session identifiers to ensure that data flows to the correct
    destination

Presentation Layer

  • Handle data representation, security, and compression
  • Ensure compatibility of data formats between the sender and receiver
    Formats include: JPEG, ASCII, DECOIC, encryption formats, etc.

Application Layer

  • The topmost layer in the network protocol stack
  • Handle communication tasks related to specific applications
  • Interfaces between network services and end users
    Protocols include: HTTP, FTP, TFTP, SMTP, SNMP, DNS, TELNET, HTTPS, POP3, DHCP.

TCP/ITC

Merge Physical Layer and Data Link Layer
Merge Session Layer, Presentation Layer, Application Layer

Include the device driver in the operating system and the corresponding network interface card in the computer, handling the details of the physical interface with the cable.

Network Layer

Handle packet activity in the network, such as packet routing.
Protocol: IP protocol (Internet Protocol), ICMP protocol (Internet Internet Control Message Protocol), and IGMP protocol (Internet Group Management Protocol)

Transport Layer

Provides end-to-end communication between applications on two hosts
Protocol : TCP (Transmission Control Protocol) and UDP (User Datagram Protocol)

TCP
Provide high-reliability data communication for two hosts, and divide the data handed over by the application into suitable small pieces and hand it over to the lower network layer for transmission.
Acknowledge the received packet, set the timeout clock for sending the last acknowledgment packet, etc.
Since the transport layer provides highly reliable end-to-end communication, the application layer can ignore all these details

UDP
Sends packets called datagrams from one host to another, but there is no guarantee that the datagram will reach the other end, any necessary reliability must be provided by the application layer to provide.

Differences:

  1. UDP has better real-time performance, and its work efficiency is higher than that of TCP. It is suitable for high-speed transmission and real-time communication or broadcast communication.
    • Each TCP connection can only be point-to-point;
    • UDP supports one-to-one, one-to-many, many-to-one and many-to-many interactive communications
  2. TCP requires more system resources, while UDP has more requirements for system resources few.
  3. TCP is a stream-oriented protocol, while UDP is a datagram-oriented protocol.
  4. TCP is a connection-oriented protocol, while UDP is a connectionless protocol.
  5. TCP provides reliable data transmission, while UDP does not provide reliable data transmission.

Application Layer

Responsible for handling specific application details.
Almost all different TCP/IP implementations provide the following common applications:
Telnet remote login.
FTP File Transfer Protocol.
SMTP Simple Mail Transfer Protocol.
SNMP Simple Network Management Protocol.