Skip to content
Boston Identity

Chapter 5

Computer Network Basics

Part I · Modern Web Apps and Networks20 min read

In the IAM world, possessing a comprehensive understanding of networks is crucial. Networks provide the infrastructure that connects software applications, devices, and users, enabling efficient data exchange and communication.

Knowledge of network protocols, such as TCP/IP, UDP, and HTTP, allows software developers to design and implement applications that can effectively communicate over networks.

Understanding network architectures, such as client-server and peer-to-peer models, helps design software solutions that align with the underlying network infrastructure. Furthermore, being well-versed in network security concepts, such as encryption, authentication, and firewalls, enables developers to build secure software systems and protect sensitive data from unauthorized access.

Additionally, as software applications often rely on network-based services, such as APIs or cloud platforms, understanding networking principles facilitates seamless integration with these services.

Key Points

  • Networks: Connect devices for data transmission.
  • Data Communication: Involves message, sender, receiver, medium, and protocol.
  • Transmission Modes: Simplex (one direction), half-duplex (both directions, not simultaneous), full-duplex (simultaneous).
  • Network Components: Work devices (workstations, servers), control devices (hubs, switches, routers, gateways).
  • Network Types: PAN (personal), LAN (local), MAN (metropolitan), WAN (wide), Internet.
  • Intranet/Extranet: Private networks for internal (intranet) or controlled external (extranet) access.
  • LAN Technologies: Ethernet (various speeds), VLANs (segment LANs).
  • Network Topologies: Physical/logical arrangement of devices (point-to-point, bus, star, ring, mesh, tree, hybrid).
  • OSI Model: 7-layer framework for network communication:
    • Application: User interaction (HTTP, SMTP).
    • Presentation: Data formatting (encryption, compression).
    • Session: Communication management.
    • Transport: Data segmentation and flow control (TCP).
    • Network: Routing and addressing (IP).
    • Data Link: Intra-network communication.
    • Physical: Hardware (cables, bits).
  • Internet Model (TCP/IP): Simplified 4-layer model.

Computer Networking

A Computer Network is a set of two or more computers and devices that will transmit or receive data through cable or wireless media.

Here is an example of a simple home network.

Diagram: Computer Networking

A router is used to route traffic to various network end devices and a modem is used to allow home networks to connect to the Internet through telephone lines.

On the other hand, a network system could be complex as well.

Diagram: Computer Networking

We’ll look at more details in the later part. Let’s first start with a basic data communication model.

Data Communication Model

This is a basic model for two nodes in a network to communicate:

Diagram: Data Communication Model

There are 5 components here:

  • Message: the information or data being delivered
  • Sender: the node which sends out the message
  • Receiver: the node where the message is being sent to
  • Medium: the medium through which the message travels
  • Protocol: a set of rules define how message should be communicated

Here is a quick example. You open a browser from your laptop and type in the URL of the YouTube homepage.

Diagram: Data Communication Model
  • Message: the HTTP request to access the YouTube home page
  • Sender: your laptop
  • Receiver: YouTube server
  • Medium: your local cable or wireless, global optical fiber
  • Protocol: TCP/IP

Transmission Modes

The transmission mode decides the direction of data flow and has three categories:

  • Simplex
  • Half-Duplex
  • Full-Duplex

Simplex Mode

In Simplex Mode, data transmits in one direction only.

Diagram: Simplex Mode

Sender can only send data and receiver can only receive data. Television is an example of simplex mode transmission.

Half-Duplex Mode

In Half-Duplex Mode, transmission happens in both directions, but they cannot happen at the same time.

Diagram: Half-Duplex Mode

If one device is sending data, then the other device cannot send data until the transmitted data is received. A walkie-talkie works in this mode.

Full-Duplex Mode

In Full-Duplex Mode, both devices can send and receive data simultaneously. Mobile phones we use are an example of this mode.

Diagram: Full-Duplex Mode

Typical Network Components

A network can contain various devices and those devices in general can be two categories: work devices and control devices.

Work devices can be workstations, laptops, servers, printers etc.

Control devices can be hubs, routers, switches, gateways, bridges, etc.

Here are some typical ones:

  • Workstation – individual computer or group of computers, used by a single user to perform work
  • Server – a computer provides functionality for other devices
  • Modem – a device that allows computer to connect to the internet over existing telephone line
  • Hub – most basic device that connects multiple computers or other network devices together; replaced by switches nowadays
  • Switch – does what a hub does, but more efficiently
  • Router – does what a switch does, but even more intelligently
  • Gateway – does what a router does, plus translation between networking technologies
  • Bridge – used to connect two or more hosts or network segments together
  • Wireless Access Points – creates a wireless local area network (WLAN)

Modem VS Router

A modem (modulator-demodulator) is a device used to modulate and demodulate signals. It is used to connect you to an ISP (Internet Service Provider) such as Xfinity. It does not help to examine the data packet and is usually placed between a telephone line and a router.

A router is a networking device that allows you to create LAN or WAN. Internet comes to Modem and then to router and then to your devices via either Ethernet cable or WIFI signal. Router examines all data packets before forwarding it. It is usually placed between a computer network and modem.

Router VS Switch

A network router serves two primary functions: 1. Create and maintain a local area network; 2. Manage the data moving inside the network as well as entering and leaving the network. Router operates at Layer 3 (Network) in the OSI model and can perform NAT. Router operations revolve around IP Addresses. Routers can work with both wired and wireless networks.

A network switch connects various devices together on a single computer network. Since the process of linking network segments is also called bridging, switches are also referred to as bridging devices. Switch operates at Layer 2 (Data Link Layer) in OSI model and can’t perform NAT. Switches work with MAC addresses as it operates within the limit of a single network. Switches are restricted to wired network connections.

What is an Internet Service Provider (ISP)?

An ISP is usually a company that can provide you with access to the internet. Without subscription to ISP, even if you have a shiny computer with premium modem and router, you won’t have a connection to Internet.

Whereas anyone can have a website, not everyone can be an ISP. It takes money, infrastructure and a great number of technicians to maintain miles of cables as well as services for hundreds of thousands of subscribers.

Computer Network Types

Generally speaking, networks are recognized based on their geographical span. It can be as small as the distance between your mobile phone and its Bluetooth headphone and as large as the internet itself.

Personal Area Network (PAN)

A PAN is the smallest network which is personal to a user, which may include devices like Bluetooth keyboard, mouse, headphone, printers, etc. PAN has connectivity range up to 10 meters.

Diagram: Personal Area Network (PAN)

Local Area Network (LAN)

A computer network spanned inside a building and operated under a single administrative system is usually referred to as LAN. Number of systems connected in LAN may vary from two to as many as hundreds of thousands.

Regardless of size, a LAN’s single defining characteristic is that it connects devices that are in a single, limited area.

The advantages of a LAN are the same as those for any group of devices networked together. The devices can use a single internet connection, share files with one another, print to shared printers, and be accessed and even controlled by one another.

Diagram: Local Area Network (LAN)

Metropolitan Area Network

MAN covers a larger area than LAN while smaller area as compared to WAN. It connects two or more computers that are apart but reside in the same or different cities.

In general, a MAN is either owned by a user or by a network provider who sells service to users, rather than a single organization as in LAN.

Diagram: Metropolitan Area Network

In the above MAN, an ISP (Internet Service Provider) provides network service to different groups within the city.

Wide Area Network

WAN covers a wide area which may span across provinces or even countries. Generally speaking, telecommunication networks are WAN. These networks provide connectivity to MANs and LANs.

Diagram: Wide Area Network

The above diagram shows two LANs in two different cities. They are connected through the internet to form a WAN.

Internet

The Internet can be seen as a WAN, but the largest WAN on planet earth.

The Internet enables users to share and access enormous amounts of information worldwide. At a grand level, the internet works on the Client-Server model.

The Internet uses fiber optic cable as its infrastructure to connect around the world. To connect various continents, fiber optic cables are laid under the sea as submarine communication cables.

Internet is tightly involved in many aspects of our life, as we know:

  • Web sites
  • Email
  • Instant Messaging
  • Blogging
  • Social Media
  • Marketing
  • Resource Sharing
  • Audio and Video Streaming

The following map shows global fiber optic cable under the sea.

Diagram: Internet

Intranet

Intranet is defined as a private network of computers within an organization with its own server and firewall.

The general difference between Internet and Intranet is that the Internet is a public network which is not owned by any entity, while an intranet is privately owned and not always accessible to the public. Oftentimes, a company or organization has their own intranet network and members or employees will have access to it.

Intranet can be a LAN or a WAN. We just wouldn’t use the term Intranet for a LAN with a home network of a couple of computers. More specifically, we use Intranet in regards to an enterprise or organization.

For example, a company has three offices globally, one in the US, one in China and One in Brazil. Each office has its own building and each building forms a LAN. Then this LAN is connected through the internet to form a WAN. However, even though the three offices are connected through the internet, the WAN network is not accessible to the public, as the company uses a firewall to block all unauthorized traffic. This WAN acts as an Intranet for the company.

Diagram: Intranet

Intranet provides such advantages as easy storage of files and information, easy ways to communicate among employees, more security for organization’s information and properties, etc.

Extranet

An Intranet is a network where employees can create content, communicate, collaborate, get stuff done and develop the company culture. On the other hand, an Extranet is like an Intranet, but provides controlled access to authorized customers, vendors, partners, or others outside the company.

Conceptually, the relationship looks like this:

Diagram: Extranet

Intranet and extranet support two different areas within a business, but have similar goals: to improve how employees work with clients and each other.

Intranet VS Extranet VS Internet

Simply put:

  • Intranet is shared content accessed by members within a single organization
  • Extranet is shared content access by groups through cross-enterprise boundaries
  • Internet is global communication accessed through the Web
Diagram: Intranet VS Extranet VS Internet

The Internet, extranet, and intranet all rely on TCP/IP technologies. The difference lies in the level of access allowed inside and outside the organization.

Intranet allows organization members to access an extensive amount of resources. Extranet expands the scope of the network by allowing non-members such as vendors and customers to use company resources. Yet, as they are not internal members, they will have limited privileges accessing organization resources. Then, the Internet expands the scope of the network even further to the global facing public. Here the organization is part of the internet and all internet end computers may access its resources, but the privileges will be limited even further, as it is public facing.

LAN Technology Types

Ethernet

Ethernet is the most common type of LAN in use today. It is popular because it strikes a good balance between speed, cost and ease of installation.

A standard Ethernet network can transmit data at a rate up to 10 Megabits per second (10 Mbps). IEEE developed an Ethernet standard known as IEEE Standard 802.3, which defines rules for configuring an Ethernet network and also specifies how the elements in Ethernet network interact with one another.

Fast Ethernet

As the development of technology and performance, there is a need for higher transmission speed and hence an upgraded version of Ethernet – Fast Ethernet (IEEE 802.3u). The speed limit has been raised from 10 Mbps to 100 Mbps with only minor changes to the previous cable structure.

Gigabit Ethernet

Gigabit Ethernet was developed to meet the need for even faster communication with such applications as multimedia. It is defined in the IEEE 802.3 standard and is currently used as an enterprise backbone.

10 Gigabit Ethernet

10 Gigabit Ethernet is the fastest and so far, the most recent of Ethernet standards. IEEE 802.3ae defines a version of Ethernet with a nominal rate of 10 Gbits/s that makes it 10 times faster than Gigabit Ethernet.

Unlike other Ethernet systems, 10 Gigabit Ethernet is based entirely on the use of optical fiber connections.

This developing standard is stepping away from the LAN design where it broadcasts to all the nodes within the network. Instead, it goes toward a system which includes some elements of wide area routing.

Virtual LAN (VLAN)

VLAN is a solution to divide a single Broadcast domain (or a LAN) into multiple Broadcast domains. Devices in one VLAN domain cannot speak to a device in another VLAN domain.

Let’s take a look at the below example.

Diagram: Virtual LAN (VLAN)

We have a LAN from an enterprise, which connects office 1, office 2 and office 3. Yet, we have two departments here: A and B. We would like to divide them into two domain groups so that work machines won’t talk across departments. Hence, we set up two VLAN with Domain A and Domain B.

VLAN can be configured through network switches.

Network Topologies

Network Topology is how devices are arranged and connected in a network. The concept of network topology can be either physical or logical.

Point-to-Point

Point-to-point networks contain just two hosts.

Often, computers or devices are connected back-to-back using a single piece of cable.

Diagram: Point-to-Point

Again, this Point-to-Point connection can be either physical or logical.

Bus Topology

In the Bus topology, all hosts (devices) are connected to a single communication line.

Diagram: Bus Topology

Bus topology is fairly easy to understand and set up. It can be used in small networks. The issue is that as the number of connected hosts increases, the performance will decrease. Furthermore, a cable failure could result in the entire network failure.

Star Topology

In Star Topology, all hosts are connected to a central host, known as the hub. The connection between hub and end host can be considered as a Point-to-Point connection.

Diagram: Star Topology

Hub plays an important role in this topology. It has a central network control point which is easier to maintain and troubleshoot. The setup is fairly straightforward. Yet, a premium hub could still be expensive and it’s acting as a single point of failure. Performance is also dependent on the capacity of the hub.

Ring Topology

In Ring Topology, each host connects to exactly two other hosts, creating a circular network structure.

Diagram: Ring Topology

When one host tries to communicate or send a message to a host that is not adjacent to it, the data travels through all intermediate hosts.

Transmitting in ring topology is not quite affected by high traffic or adding more nodes and it doesn’t cost a lot to install. Yet, troubleshooting could be problematic and adding or removing a host will disturb the network.

Daisy Chain Topology

This is similar to the Ring Topology, all hosts are connected to the adjacent host, except the two end hosts.

Diagram: Daisy Chain Topology

Mesh Topology

In Mesh Topology, one host is connected to one or multiple hosts.

Diagram: Mesh Topology

Mesh topology has two types:

  • Full Mesh: All hosts have a point-to-point connection to every other host in the network. This provides the most reliable network structure among all network topologies.
  • Partial Mesh: Not all hosts have point-to-point connection to every other host. This means hosts connecting to each other can be in some arbitrary fashion.

For a mesh topology, it is usually robust and easy to troubleshoot. The down side includes difficult setup, higher cable cost and bulk wiring.

Tree Topology

Tree Topology is also called Hierarchical Topology. It is the most common form of network topology in use so far.

Diagram: Tree Topology

This topology divides the network into multiple layers.

  • The root of the tree is the core layer, which serves as the central point of the network.
  • The middle layer is the distribution layer, which works as mediator between upper layer and lower layer
  • The lower layer is the access layer, where computers are connected

The good side of a tree topology is easy node addition/deletion, easy management and troubleshooting. The downside would be high cost, the core layer acts as a single point of failure.

Hybrid Topology

A Hybrid Topology consists of more than one topology.

Diagram: Hybrid Topology

A hybrid topology usually inherits the merits from the prime topologies. The above diagram shows the combination of Ring Topology and Star Topology.

The Internet can be considered as the largest Hybrid Topology.

OSI Model

OSI (Open Systems Interconnection) is a conceptual framework for how applications communicate over a network. The OSI model can be seen as a universal language for computer networking.

The model partitions the system into 7 different abstract layers and each layer performs a particular network function as well as communicating with the layers above and below itself.

Although the modern Internet doesn’t strictly follow the OSI model, the OSI model is still very useful as a reference for understanding network behaviors. For example, if we encounter a web app server down, the OSI model can help to break down the problem and isolate the source of the trouble. If we can narrow down to one specific layer of the model, a lot of unnecessary work can be avoided.

Diagram: OSI Model

Let’s take a look at each layer more closely from top to bottom.

Application Layer (Layer 7)

This is the only layer where the user directly interacts with data.

Web applications accessed by browser or email client rely on Layer 7 for communication, though browsers and clients are NOT part of the application layer. The application layer is more responsible for the protocols and data transmission. Application layer protocols include HTTP, SMTP etc.

Diagram: Application Layer (Layer 7)

Presentation Layer (Layer 6)

Layer 6 is primarily responsible for preparing data so that it can be used by Layer 7 (Application Layer). That is to say, Layer 6 makes the data presentable for applications to consume. This layer is responsible for data translation, encryption and compression.

Diagram: Presentation Layer (Layer 6)

If two communicating nodes are using different encoding methods, Layer 6 will translate incoming data into proper syntax that the receiving node can understand.

If the communication is over an encrypted connection, Layer 6 will encrypt data before sending and decrypt data after receiving.

Layer 6 can also help to compress data for transmission which improves the speed and efficiency of communication.

Session Layer (Layer 5)

Layer 5 is responsible for opening and closing communication between two nodes.

When a connection is established between two nodes, a session is created. This session will have its duration which will depend on various factors. Layer 5 ensures the session stays open long enough to transfer all the data being exchanged, and then closes the session in a timely manner.

Diagram: Session Layer (Layer 5)

Transport Layer (Layer 4)

Layer 4 deals with data transport. This includes taking data from Layer 5 and breaking it up into chunks (segments) before sending it to Layer 3. The transport layer on the receiving end will reassemble the segments into original data where Layer 5 can consume.

Diagram: Transport Layer (Layer 4)

Layer 4 is also responsible for flow control and error control. For example, a fast connection shouldn’t overwhelm a receiver which has a slow connection; the data assembled should be complete on the receiving end.

Network Layer (Layer 3)

Layer 3 is responsible for facilitating data transfer between two different networks. This layer is unnecessary if the two nodes are communicating in the same network.

Layer 3 breaks up segments from Layer 4 into smaller units, called “packets”, on the sending node and then routes and transports them to the receiving end, where those packets are assembled.

Diagram: Network Layer (Layer 3)

Layer 2 is similar to Layer 3, except this layer facilitates data transfer between two nodes within the SAME network.

Layer 2 takes packets from Layer 3 and breaks them into smaller pieces called “Frames”.

Similar to Layer3, the data link layer is responsible for flow control and error control in intra-network communication.

Diagram: Data Link Layer (Layer 2)

Physical Layer (Layer 1)

Layer 1 refers to the physical equipment involved in the data transfer, such as cables and switches.

With layer 1, data will be converted into streams of bits, which are strings of 1s and 0s.

Diagram: Physical Layer (Layer 1)

How Data Flows through the OSI Model

We know the layer for user computer interaction is layer 7 – the Application layer; however, in order for data to travel from one node to another in the network, the data needs to go through layer 1 – the Physical layer. In this case, data will travel the 7 levels from layer 7 to layer 1 and then from layer 1 to layer 7, as shown in the diagram.

Diagram: How Data Flows through the OSI Model

Let’s take a look at an example. John wants to send an email to William.

Sender operations start with John composing his message in an email application and clicking the “send” button.

  • The email application will pass the email message over Layer 7 (Application Layer) with SMTP (Simple Mail Transfer Protocol) and transfer the data to Layer 6 (Presentation Layer).
  • Layer 6 compresses the data and sends to Layer 5 (Session Layer)
  • Layer 5 initializes the communication session with the receiver
  • Then data will come to Layer 4 (Transport Layer) where the data will be segmented and passed to Layer 3 (Network Layer)
  • Layer 3 breaks down segments into packets and passes to Layer 2 (Data Link Layer)
  • The data segments will be broken down even further into frames in Layer 2 and then sent to Layer 1 (Physical Layer)
  • Layer 1 converts the data into a bitstream of 0s and 1s and send them through a physical medium, e.g. network cable to the receiver

Receiver operations starts with William’s computer receiving the bitstream through a physical medium, e.g. WIFI; the data will flow through the same series of 7 layers on his device, but in the opposite order

  • Layer 1 will convert the bitstream from 0s and 1s to frames and pass to Layer 2
  • Layer 2 reassembles frames into packets for Layer 3
  • Layer 3 will create segments out of the packets and pass to Layer 4
  • Layer 4 will assemble the segments into one piece of data and pass to Layer 5
  • Layer 5 will pass the data to Layer 6 and end the connection
  • Layer 6 then removes the compression and pass the raw data to Layer 7
  • Layer 7 then feed the human-readable data to William’s email application, which allow him to read John’s email

Next, let’s take a look at the Internet Model, which dominates the world right now.

Internet Model (TCP/IP Model)

The OSI model is good at letting people concentrate on the specifics of a network implementation. Yet, implementation based directly on the OSI model is not that popular, mainly due to its complexity – Sticking rigidly to the layers and their isolation will add extra work which is sometimes unnecessary.

The Internet Model, or the TCP/IP model (as the Internet is based on TCP/IP), is a 4-layer model instead of 7. Compared to the OSI model, TCP/IP model is a simpler, easy-to-understand, more practical proposition.

Diagram: Internet Model (TCP/IP Model)
  • Application Layer: defines the protocol which enables user interaction with the network, e.g. HTTP, FTP, SMTP etc.
  • Transport Layer: defines how data should flow between hosts. The major protocol at this layer is TCP (Transmission Control Protocol). This ensures that the data delivered is in correct order.
  • Network Layer: IP (Internet Protocol) works on this layer. The functionality of this layer is host addressing and recognition. It also defines routing.
  • Link Layer: sending and receiving actual data. Unlike the OSI model, the Link Layer here is independent of underlying network hardware and architecture.