You are on page 1of 24

Computer Networks

Networks are made up of various devices—computers, switches, routers—connected together


by cables or wireless signals. Understanding the basics of how networks are put together is an
important step in building a wireless network in a community or neighborhood.

This module covers the concepts of:

Clients and servers—how services such as e-mail and web pages connect using networks.
IP addresses—how devices on a network can be found.
Network hubs, switches and cables—the hardware building blocks of any network.
Routers and firewalls—how to organize and control the flow of traffic on a network.
 
Clients and Servers 
An important relationship on networks is that of the server and the client. A server is a computer
that holds content and services such as a website, a media file, or a chat application. A good
example of a server is the computer that holds the website for Google’s search page:
http://www.google.com. The server holds that page, and sends it out when requested.

A client is a different computer, such as your laptop or cell phone, that requests to view,
download, or use the content. The client can connect over a network to exchange information.
For instance, when you request Google’s search page with your web browser, your computer is
the client.

In the example below, two computers are connected together with an Ethernet cable. These
computers are able to see each other and communicate over the cable. The client computer
asks for a website from the server computer. The website is delivered from the server, and
displayed on the client’s web browser.

IP Addresses 
In order to send and direct data across a network, computers need to be able to identify
destinations and origins. This identification is an IP—Internet Protocol—address. An IP address
is just a set of four numbers between 1 and 254, separated by dots. An example of an IP
address is 173.194.43.7.

An IP address is similar to a street address. Parts of the address describe where in the world
the building is located, another part narrows it down to a state or city, then the area within that
state or city, then the location on the street.
Below we can see 192.168.1 Street. On it are three houses:

The complete addresses for each of these houses is: 192.168.1.20, 192.168.1.21, and
192.168.1.22.

There are different classifications, or types of IP addresses. A network can be public, or it can
be private. Public IP addresses are accessible anywhere on the Internet. Private IP addresses
are not, and most are typically hidden behind a device with a public IP address.

Here we can see an example—a street with two buildings with public IP
addresses—representing computers with addresses that are visible to the entire Internet. These
buildings might be anywhere in the world, but their addresses are complete, so we know exactly
where they are and can send messages to them.

To see an example of how public and private IP addresses are commonly used, let’s take
another look at 192.168.1 Street. We have a new building on the street. That building has a
public IP address, and a private IP address. There is also a fence that blocks the rest of the
Internet from seeing and passing messages to addresses on the street.
The postal building controls messages that travel between the Internet and the street, keeping
track of messages that leave the street, and directs return messages to the right house. On the
street, it has the address 192.168.1.1, and on the Internet it has the address 74.10.10.50.

The IP address is 32-bit but we write it down in 4 blocks of 8 bits. 8 bits is what we call a
“byte”. So the IP address will look like this:

Classful Addressing 

The 32 bit IP address is divided into five sub-classes. These are: 

● Class A 
● Class B 
● Class C 
● Class D 
● Class E 

Each of these classes has a valid range of IP addresses. Classes D and E are reserved 
for multicast and experimental purposes respectively. The order of bits in the first octet 
determines the classes of IP addresses. 

IPv4 address is divided into two parts: 

● Network ID 
● Host ID 
The class of IP address is used to determine the bits used for network ID and host ID 

and the number of total networks and hosts possible in that particular class. Each ISP 

or network administrator assigns IP address to each device that is connected to its 

network. 

Note: ​IP addresses are globally managed by Internet Assigned Numbers 


Authority(IANA) and regional Internet registries(RIR). 

Why are the first 3 bytes the “network” part and why is the last byte the “host” part? Good
question! I only gave you the IP address but you might remember that if you configure an IP
address you also have to specify the subnet mask. Our IP address 192.168.1.1 would come
along with the subnet mask 255.255.255.0.

The subnet mask tells your computer which part is the “network” part and which part is the
“host” part. Despite the name it does not “hide” or “mask” anything. We’ll talk about binary
and subnetting calculations later on, for now just hold the thought that your subnet mask
tells us which part of the IP address is the “network” part and which part is for “hosts”.

 
 
Class A: 
IP addresses belonging to class A are assigned to the networks that contain a large 

number of hosts. 

● The network ID is 8 bits long. 


● The host ID is 24 bits long. 

The higher order bit of the first octet in class A is always set to 0. The remaining 7 bits 

in the first octet are used to determine network ID. The 24 bits of host ID are used to 

determine the host in any network. The default subnet mask for class A is 255.x.x.x. 

Therefore, class A has a total of: 

● 2^7-2= 126 network ID(Here 2 address is subtracted because 0.0.0.0 and 


127.x.y.z are special address. ) 
● 2^24 – 2 = 16,777,214 host ID 

IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x 

Class B: 

IP addresses belonging to class B are assigned to the networks that range from 

medium-sized to large-sized networks. 

● The network ID is 16 bits long. 


● The host ID is 16 bits long. 

The higher order bits of the first octet of IP addresses of class B are always set to 10. 

The remaining 14 bits are used to determine network ID. The 16 bits of host ID is used 

to determine the host in any network. The default sub-net mask for class B is 

255.255.x.x. Class B has a total of: 

● 2^14 = 16384 network address 


● 2^16 – 2 = 65534 host address 

○ IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x. 

Class C: 
IP addresses belonging to class C are assigned to small-sized networks. 

■ The network ID is 24 bits long. 


■ The host ID is 8 bits long. 

The higher order bits of the first octet of IP addresses of class C are always set to 110. 
The remaining 21 bits are used to determine network ID. The 8 bits of host ID is used to 
determine the host in any network. The default sub-net mask for class C is 
255.255.255.x. Class C has a total of: 
○ 2^21 = 2097152 network address 
○ 2^8 – 2 = 254 host address 
IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x. 
 
Range of special IP addresses: 
169.254.0.0 – 169.254.0.16​ : Link local addresses 
127.0.0.0 – 127.0.0.8​ : Loop-back addresses 
0.0.0.0 – 0.0.0.8​ : used to communicate within the current network. 
   
Summary of Classful addressing : 
 

 
● If you look closely, do you see a 127.0.0.0 subnet? It’s not in the class A range
so what happened to it?
● Why does Class C stop at 223.255.255.255?

To answer the first question: Go to your command prompt of your computer and type in
“ping 127.0.0.1” and you’ll get a response. This network range is being used as a
“loopback”. Your loopback interface is something to check if your IP stack is OK.

To answer the second question I have to tell you that there’s actually a class D range,
we don’t use those IP addresses to assign to computers but it’s being used for
“multicast”. It starts with the 224.0.0.0 range.

The last thing I need to tell you about classes is the difference between “private” and
“public” IP addresses.

● Public IP addresses are used on the Internet.


● Private IP addresses are used on your local area network and should not be
used on the Internet.

These are the Private IP address ranges:

● Class A: 10.0.0.0 – 10.255.255.255


● Class B: 172.16.0.0 – 172.31.255.255
● Class C: 192.168.0.0 – 192.168.255.255

Do you see our 192.168.1.1 example IP address falls within class C and is a private IP
address? I like to use this IP address since it’s most common to people, it’s used a lot on
home networks and SOHO (small office home office) routers.

Is there anything else we need to know about IP addresses? Well yes, one last thing! There
are 2 IP addresses we cannot use on our network.

● Network address.
● Broadcast address.

The network address cannot be used on a computer as an IP address because it’s being
used to “define” the network.
The broadcast address cannot be used on a computer as an IP address because it’s used
by broadcast applications. A broadcast is an IP packet that will be received by all devices in
your network.

So how do we recognize these two IP addresses that we cannot use? An example for this:

Let’s use the Class C range and our IP address 192.168.1.1.

We need to look at the last octet which is being used for hosts. If we set all the bits to 0 in
our “host” part then we have the network address:

So 192.168.1.0 is the network address in this case and we are unable to use this IP
address for computers. If we set all the bits to 1 we’ll have a broadcast IP address and we
also cannot use this for computers:

So in summary:

● Set all the host bits to 0 gives you the network address.
● Set all the host bits to 1 gives you the broadcast address.
● These 2 IP addresses we cannot use for computers.

Layers of OSI Model 


OSI stands for Open Systems Interconnection. It has been developed by ISO –
‘International Organization of Standardization‘, in the year 1984. It is a 7 layer
architecture with each layer having specific functionality to perform. All these 7 layers
work collaboratively to transmit the data from one person to another across the globe.

 
 
TCP/IP Model 
The O
​ SI Model​ we just looked at is just a reference/logical model. It was designed to 

describe the functions of the communication system by dividing the communication 

procedure into smaller and simpler components. But when we talk about the TCP/IP 

model, it was designed and developed by the Department of Defense (DoD) in the 1960s 

and is based on standard protocols. It stands for Transmission Control 

Protocol/Internet Protocol. The ​TCP/IP model​ is a concise version of the OSI model. It 

contains four layers, unlike seven layers in the OSI model. The layers are: 

1. Process/Application Layer 
2. Host-to-Host/Transport Layer 
3. Internet Layer 
4. Network Access/Link Layer 

The diagrammatic comparison of the TCP/IP and OSI model is as follows : 


Difference between TCP/IP and OSI Model: 

TCP/IP  OSI 

TCP refers to 


OSI refers to Open Systems 
Transmission Control 
Interconnection. 
Protocol. 

TCP/IP has 4 layers.  OSI has 7 layers. 

TCP/IP is more reliable  OSI is less reliable 

TCP/IP does not have 


OSI has strict boundaries 
very strict boundaries. 

TCP/IP follow a 
OSI follows a vertical approach. 
horizontal approach. 

TCP/IP uses both  OSI uses different session and 


session and  presentation layers. 
presentation layers in 
the application layer 

itself. 

TCP/IP developed  OSI developed the model then 

protocols then model.  protocol. 

Transport layer in 


In the OSI model, the transport 
TCP/IP does not provide 
layer provides assurance delivery 
assurance delivery of 
of packets. 
packets. 

TCP/IP model network  Connection less and connection 

layer only provides  oriented both services are 

connection less  provided by the network layer in 

services.  OSI model. 

While in the OSI model, Protocols 


Protocols cannot be 
are better covered and are easy 
replaced easily in 
to replace with the change in 
TCP/IP models. 
technology. 
Media  Access  Control  (MAC)  Address  –​MAC  Addresses  are 
unique  ​48-bits  hardware  numbers  of  a  computer,  which  is  embedded  into  a  network 

card  (known  as  ​Network  Interface  Card​)  during  the  time  of  manufacturing.  MAC 

Address  is  also  known  as  ​Physical  Address  of  a  network  device.  In  IEEE  802  standard, 

Data Link Layer is divided into two sublayers – 

1. Logical Link Control(LLC) Sublayer 


2. Media Access Control(MAC) Sublayer 

MAC address is used by Media Access Control (MAC) sublayer of Data-Link 


Layer. MAC Address is word wide unique, since millions of network devices exist 
and we need to uniquely identify each.

Format of MAC Address – 

MAC Address is a 12-digit hexadecimal number (6-Byte binary number), which is mostly 

represented by Colon-Hexadecimal notation. First 6-digits (say 00:40:96) of MAC 

Address identifies the manufacturer, called OUI (​Organizational Unique Identifier​). IEEE 

Registration Authority Committee​ assigns these MAC prefixes to its registered vendors. 

 
Here are ​some OUI​ of well known manufacturers : 

Note:​ Colon-Hexadecimal notation is used by ​Linux OS​ and Period-separated 


Hexadecimal notation is used by C
​ isco Systems​. 
Unicast – ​A Unicast addressed frame is only sent out to the interface leading to specific 
NIC. If the LSB (least significant bit) of the first octet of an address is set to zero, the 
frame is meant to reach only one receiving NIC. The MAC Address of the source 
machine is always Unicast. 

 
Multicast – ​Multicast address allow the source to send a frame to group of devices. In 
Layer-2 (Ethernet) Multicast address, LSB (least significant bit) of first octet of an 
address is set to one. IEEE has allocated the address block 01-80-C2-xx-xx-xx 
(01-80-C2-00-00-00 to 01-80-C2-FF-FF-FF) for group addresses for use by standard 
protocols. 

Broadcast – S
​ imilar to Network Layer, Broadcast is also possible on underlying layer( 
Data Link Layer). Ethernet frames with ones in all bits of the destination address 
(FF-FF-FF-FF-FF-FF) are referred as broadcast address. Frames which are destined with 
MAC address FF-FF-FF-FF-FF-FF will reach to every computer belong to that LAN 
segment. 
 

Network Hubs and Switches 


Traditionally, computers are connected to each other using cables—creating a network.
The cable used most often is Ethernet, which consists of four pairs of wires inside of a
plastic jacket. It is physically similar to phone cables, but can transport much more data.

But cables and computers alone do not make a good network, so one early solution was
to use a network hub. The Ethernet cables from the computer connect to the device
similar to the hub of a bike wheel—where all of the spokes come together in the center.

An example of how a hub works is shown below. Computer A wants to send a message
to computer B. It sends the message through the Ethernet cable to the hub, then the
hub repeats the message to all of the connected computers.
A network using a hub can slow down if many computers are sending messages, since
they may try and send messages at the same time and confuse the hub. To help with
this problem, networks began to use another device called a switch. Instead of
repeating all messages that come in, a switch only sends the message to the intended
destination. This eliminates the unnecessary repetition of the hub.

Using a switch, computer A sends a message to computer B—the other computers do


not see the message. Those computers can send other messages at the same time
without interfering.

Switches do have a limitation though—they only know about the addresses of


equipment that is plugged directly into them. So, you can only send messages to a
small number of devices—however many ports the switch has! If you need to send a
message to a computer on another network, it will need to be sent through a router,
which we discuss next.

MAC Table​ (Layer 2)

The MAC table is used by the switch to map MAC Addresses to a specific interface on the
switch. These usually expire every 5 minutes or so, and are updated by reading the source
address of the frame entering the interface. Your switch should have a MAC/CAM Table as
a layer 2 device.

ARP Table​ (Layer 3)

The ARP table is used to map MAC Addresses to IP addresses. If no ARP entry exists, an
ARP broadcast is sent out, and the table is updated with the response. These usually expire
after 2-4 hours. Each host connected to the network should maintain its own ARP Table.

Routers and Firewalls 


Routers do the majority of the hard work on a network - they make the decisions about
all the messages that travel on the network, and whether to pass messages to and from
outside networks. There are three main functions:
Separate and Bridge

Routers separate networks into sections, or bridge different networks together, as we see in the
example above—the private network of 192.168.1 Street is bridged to the Internet with a public
IP address.

Assign IPs

They can assign IP addresses. In the example of 192.168.1 Street, if a new house is
built on the street, it would get whatever the next highest house number available. In the
case of routers, they assign IP addresses using DHCP—Dynamic Host Configuration
Protocol.

Firewall and Protect

They can filter messages or keep users out of private networks. Most routers have a
Firewall built in. This is a software function that keeps unwanted messages from
reaching the computers on the inside, or private part, of the network.

Let us take another look at 192.168.1 Street, and the postal service building we
included when it had a public address for the entire street. As it turns out, that postal
service building is acting as a Router.

In this case, the postal service building is routing messages between the rest of the
Internet using its public address and the street with private addresses.

Definitions
DHCP—Dynamic Host Configuration Protocol
It assigns IP addresses to client devices, such as desktop computers, laptops, and
phones, when they are plugged into Ethernet or connect to Wireless networks​.
Ethernet
A type of networking protocol—it defines the types of cables and connections that are
used to wire computers, switches, and routers together. Most often Ethernet cabling is
Category 5 or 6, made up of twisted pair wiring similar to phone cables.
Hub
A network device that repeats the traffic it receives to all connected devices.
Switch
A network device that sends traffic it receives to a specific connected device, such as a
single desktop computer or laptop.
Router
A network device that can bridge between different networks, determine what traffic can pass
between them, and perform other functions on a network, such as assigning IP addresses.
Firewall
A function typically performed by routers, this filters traffic between networks and can protect
them from interference or attacks.

Websites vs. Web Applications: What’s the 


Difference? 

Websites 
Websites are typically informational in nature. Think about your favorite blog or news
based site. Its primary purpose is to convey information to the end user, whether it in
the form of news, like CNN, or recipes, like you’ll find on Martha Stewart.

As a general rule, there is little or no interaction on the part of the visitor, other than
possibly submitting an email address to receive a monthly newsletter or performing a
search. So the real question is, how does this apply to you?

Well, if you’re a local charity who wants to convey information only — a homepage, an
about page, contact information, upcoming events, and maybe a description of how
you’ve helped your cause — a website might be all that you need.

Web Applications 
In contrast, web applications are usually responsible for some form of interaction with
your visitors. Yes, they’ll still be supplying information, but your visitors may want to do
something with that information. Or, through interaction, your visitors may request a
different type of information or even manipulate data.

The term “Web Application” itself makes the things clear – it is just like any other 
software or mobile application catered over the internet and used in the browser. But 
unlike websites, they provide m
​ ore functionalities and features​. We everyday use 
numerous web applications such as Gmail, Google Drive, Facebook, LinkedIn, Trello, 
Slack, etc. 

A web application can be as simple as a calculator but can also get as complex as data 
analytic software like ​Google Analytics​. Some of the core benefits that have made web 
applications so popular are: 

1. ​No installation​ – W
​ eb apps run in a browser; no need of installing to the device. 

2. ​Can run across different OS​ – ​Device segregated in different OS systems is a barrier 
for the software. Web application solves this issue. 

3. ​Accessibility​ – ​Web Applications can be accessed from any device from anywhere. 

The first web page address was


http://info.cern.ch/hypertext/WWW/TheProject.html.

You might also like