Computer Networks
Computer Networks
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
● 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.
● 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
network.
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 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.
Class B:
IP addresses belonging to class B are assigned to the networks that range from
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
Class C:
IP addresses belonging to class C are assigned to small-sized networks.
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.
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:
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.
TCP/IP Model
The O
SI Model we just looked at is just a reference/logical model. It was designed to
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
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
TCP/IP OSI
TCP/IP follow a
OSI follows a vertical approach.
horizontal approach.
itself.
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,
MAC Address is a 12-digit hexadecimal number (6-Byte binary number), which is mostly
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 :
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.
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.
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.
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 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.
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
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.