Networks

Here are my notes on a short introduction to networking course from Nvidia. This includes the different components and characteristics of a network, as well as the flow of encapsulation and OSI and TCP/IP models.


What is Networking?

A network is a collection of nodes connected to exchange data. This must be why there are so many LeetCode Graphing Problems on networking — they can be simplified down to a graph of connected nodes 🙂

Characteristics of a Network

Networks have the following characteristics:

  • Bandwidth
  • Latency
  • Availability
  • Scalability
  • Security

These are the characteristics that are important to consider when designing a network.

Network Components

Networks are made up of the following components:

  • End Nodes: Devices that are connected to the network. These are used as the source and destination of data.
  • Intermediate Nodes: Switches and routers that receive traffic generated by end nodes and make decisions on where that information is going.

Other network components include:

  • Network Cloud
  • Storage
  • Firewall
  • Server
  • Compute
  • Switch
  • L3 Switch
  • Router

Building a Network

Let’s design a simple network. The first thing we should know is that every end node has a network interface card (NIC). The NIC is a hardware component that resides in a slot and has one or more network ports. A cable connects the NIC in the end point to a switch port.

End point is another term for end node. A switch is a device that connects multiple devices on a network. It operates at the data link layer of the OSI model. OSI stands for Open Systems Interconnection, and will be discussed again in more detail below. It is a conceptual model that standardizes into seven layers the functions of a telecommunication or computing system.

So now that nodes are connected to the network, they need a way to communicate. Nodes use protocols to communicate. Each protocol is responsible for a specific set of activities and defines a comment set of rules and formates to exchange messages between devices. This includes:

  • Setup and termination of data transfer sessions
  • Message format
  • Error and system messages

A protocol suite is a group of protocols that run concurrently to implement network communication.

OSI Model

The Open Systems Interconnection (OSI) model breaks down different components of network communication into layers, makign communication easier. This will make more sense as we break down the layers themselves. OSI is a generic, protocol-independent ISO standard. There are many advantages to using a layered model, a few listed below:

  • Standardizes interfaces
  • Facilitates modular engineering
  • Ensures interoperable technology
  • Accelerates evolution - the model can be updated with new technologies easily

Here are the layers of the OSI model

  1. Physical Layer - Responsible for physical connection between layers.
  2. Data Link Layer - Responsible for error detection and correction.
  3. Network Layer - Responsible for routing and forwarding.
  4. Transport Layer - Responsible for end-to-end communication.
  5. Session Layer - Responsible for session management.
  6. Presentation Layer - Responsible for data translation.
  7. Application Layer - Responsible for user interface.

TCP/IP Model

TCP/IP models, in a way, are an implementation of the OSI model, as they are both layered models. The TCP/IP model is a suite of protocols that are used to communicate over the internet. TCP/IP defines how computers should be connected to the internet and how data can be transmitted between them.

The TCP/IP Suite is named after the two main protocols, Transmission Control Protocol and Internet Protocol.

TCP/IP includes protocols for how data should be packetized, addressed, transmitted, routed, and received; therefore, TCP/IP provides end-to-end data communication. Below are some protocols in the TCP/IP suite:

  • Link layer (network access) protocols: Ethernet and PPP (layer 2)
  • Internet layer protocols: IPv4 and IPv6 (layer 3)
  • Transport layer protocols: TCP and UDP (layer 4)
  • Application layer protocols: HTTP, FTP, DHCP, and DNS (layer 7)

The TCP/IP model has 4 layers, compared to the 7 layers of the OSI model. These 4 layers are:

  • Network Access Layer - Ethernet
  • Internet Layer - IPv4 and IPv6
  • Transport Layer - TCP and UDP - TCP stands for Transmission Control Protocol and UDP stands for User Datagram Protocol.
  • Application Layer - HTTP, FTP, DHCP, and DNS

Although there are only 4 layers, each protocol should refer to the OSI model layer. That is why internet layer protocols, IPv4 and IPv6, are considered to be on layer 3.

Model Layer Comparison

Encapsulation

Application messages (created by the application layer) are passed to a “production line” of the lower layers, where each layer adds its own information by encapsulating the data with the layer header. By the end of the encapsulation process, the encapsulated data is transmitted by the wire.

Let’s go through an example of encapsulation for the TCP/IP model:

  1. The data generated at the application layer is referred to as a message.
  2. This message is encapsulated at the lower layer, transport layer. The transport layer adds a layer 4 (transport layer) header that includes fields such as port numbers that are relevant for transport layer processing at the receiving nodes. A message with a layer 4 header is reffered to as a TCP Segment or a UDP Datagram. TCP Segments and UDP Datagrams are the layer 4 PDU (protocol data unit).
  3. The TCP Segment or UDP Datagram is passed from layer 4 (transport layer) to layer 3 (internet layer), where it is encapsulated with the layer 3 header. The layer 3 (internet layer) header includes information souch as source and destination IP addresses. The layer 3 PDUs (protocol data units) are called packets.
  4. Packets are routed in the network by layer 3 devices called routers.
  5. Packets are then passed down from layer 3 (internet layer) to layer 2 (data link layer), and given a layer 2 header. Layer 2 PDUs are called frames. The most important information in the layer 2 header are source and destination MAC addresses.
  6. Frames are forwarded in the local network by layer 2 devices called switches.
  7. The frame is then transferred to layer 1, the physical layer, and is converted to a stream of bits.
  8. The stream of bits is placed on the network medium for transmission.

Encapsulation

The resources below will cover more of these terms in more detail, but it is important to at least understand the general flow of encapsulation and the TCP/IP model.

Continuation