Networking

Table of Contents

1. Open Systems Interconnection Model

  • OSI Model
  • Defined in ISO/IEC 7498 and ITU-T X.200

7. Application Layer

6. Presentation Layer

  • Establish data formatting
  • ASN.1
    • Abstract Syntax Notation One
    • Notation for abstract types and values as specified in ITU-T X.680 to X.683.
  • Transport Layer Security (TLS)
    • Secure Socket Layer (SSL) is deprecated legacy version of TLS.
    • TLS 1.3 (since 2018) and TLS 1.2 (since 2008) are currently in use.

5. Session Layer

  • Network Socket
    • Enable Inter-Process Communication across a network, as the endpoint.
    • Identified by a socket address which is a triad of transport protocol, IP address, port number.
  • Datagram Socket
    • Connectionless. UDP.
  • Stream Socket
    • Connection-Oriented. TCP, SCTP, DCCP.
  • Raw Socket
    • Direct without transport layer.
  • Remote Procedure Call (RPC)
  • Domain Name System (DNS)

4. Transport Layer

  • Transmission Control Protocol (TCP)
    • Establish a connection
  • User Datagram Protocol (UDP)

3. Network Layer

  • Internet Protocol (IP)
    • Connectionless
  • Border Gateway Protocol (BGP)
    • Layer 4 protocol that finds the shortest route over the IP network.
  • Internet Control Message Protocol (ICMP)
    • Auxillary protocol for IPv4.

2. Data Link Layer

  • Medium Access Control (MAC)
  • Logical Link Control (LLC)
    • MAC and LLC are the sublayers defined by IEEE 802
    • Others includes 802.3 Ethernet, 802.11 Wi-Fi, 802.15.4 Zigbee

1. Physical Layer

Voltage levels, the timing of voltage changes, physical data rates, maximum transmission distances, modulation scheme, channel access

2. Application Layer

2.1. DNS

  • Domain Name System

2.1.1. Security

  • uses DoT or DoH by default.

DNS over TLS

  • DoT
  • Use the port 853.

DNS over HTTPS

  • DoH
  • Use HTTPS protocol to get the resolution.

Domain Name System Security Extensions

  • DNSSEC

2.1.2. Domain Name Server

  • DNS, DNS Server

Examples of public DNS Server

  • 1.1.1.1 cloudflare-dns.com
  • 8.8.8.8 dns.google
  • 9.9.9.9 dns.quad9.net

2.1.3. Internet Service Provider

  • ISP

The gateway can set the default DNS server for its subnetwork. 61.41.153.2 and 1.214.68.2 by U+

2.2. URI

  • Universal Resource Identifier

There are two kinds of URI:

  • URL: Universal Resource Locator — The location
  • URN: Universal Resource Name — The file

2.2.1. Protocols

Registered Protocols managed by IFTF

  • Permanant Protocol
    • Internet-wide protocols, such as and FTP, FILE.
  • Provisional Protocol
    • System-wide?

Private Protocols

  • A program can register its protocol

3. Presentation Layer

3.1. TLS

3.1.1. Handshake

  1. Handshake Begin: Client provide the server available ciphers.
  2. Server picks a cipher and notifies the client.
  3. Server provides:
    • a digital certificate which contains server name and the trusted certificate authority (CA) to prove the authenticity
    • public encryption key of the server
  4. Client confirms the validity of the certificate.
  5. Client encrypt a random number (PreMasterSecret) with the public key and send to the server.
  6. Both parties perform (or Elliptic Curve Diffie-Hellman) on that random number and generate a session key.

4. Session Layer

4.1. RPC

  • Remote Procedure Call
  • http/2 based
  • Low level control
  • Not fully supported by web
  • Suitable for internal uses

Rather than working based on the structure like the REST API, RPC directly calls for an functionality to be executed at the root, consequently requiring the method name to be within the payload.

gRPC

  • Created by google
  • It uses binary payload to communicate which required both parties to share a contract that specifies the binary format.

5. Transport Layer

5.1. TCP

  • Transmission Control Protocol

It ensures the packet integrity. Ports are part of TCP.

6. Network Layer

6.1. IP

  • Internet Protocol

An IP packet consists of sender IP, receiver IP, payload length, payload.

IP packets are passed across networks, transferring between data link layer packet such as Ethernet packets, until it reaches the target.

  • 0.0.0.0/0 refers to any IP address.
  • xxx.xxx.xxx.0/8, xxx.xxx.0.0/16 represents the network
  • xxx.xxx.xxx.255/8, xxx.xxx.255.255/16 is used for broadcasting, that is, everything within the network.

6.1.1. Subnet Mask

  • It represents which IP address range the subnetwork is using.
  • It is specified as a single number: 192.168.219.0/8, or with a full subnet mask: 255.255.255.0
    • The number specifies the number of bit from the end.

6.1.2. Gateway

  • The IP address that are not within the same subnetwork is redirected to the gateway.

6.2. ICMP

  • The packet is contained in IP, but it is treated as a special case.
  • ping and traceroute utilize this.
  • RFC1122 requires hosts to return ICMP errors whenever possible, instead of dropping packets.
    • Type 3, Code 3: DESTINATION PORT UNREACHABLE is used when manually rejecting an access to a port.

6.2.1. Control Messages

  • Type 0: ECHO REPLY
  • Type 3, Code *: DESTINATION UNREACHABLE
  • Type 11: TIME EXCEEDED.

7. Data Link Layer

7.1. Ethernet

An Ethernet packet consists of sender MAC address, receiver MAC address, payload length, payload.

7.2. ARP

  • Address Resolution Protocol

It is used to find the MAC address corresponding to an IP address within a network. The receiver MAC address is left empty.

The receiver responds with its MAC address if the IP address matches his.

7.3. Network Switch

  • Switching Hub, Bridging Hub, Ethernet Switch, MAC Bridge
  • It is a multiport network bridge.
  • Forwards data based on their destination MAC addresses.
  • Some switches use IP addresses as well, and they are specially called a multilayer switches.

8. Physical Layer

8.1. UART

The sender and receiver have to agree on the baud rate, the bit transmission rate.

8.2. I2C

8.3. SPI

9. Network Coding

The packets can be added in the hub between the sender and recipent. And when enough packets are transferred the original packets can be restored.

It is useful because it allows multiple packets to use the same wire at the same time, just using mathematics.

10. Space-Time Coding

The MIMO(Multi-Input Multi-Output) is used to counteract the effect of interferece in the radio signals.

10.1. Alamouti Scheme

Signals are sent from two different location, and it is sent twice with alternating sign difference. (AB | -BA) The signal can be reconstructed regardless of the signal fading due to interference.

11. References

Author: Jeemin Kim

Created: 2026-08-04 Tue 19:38