Computer networks consist of many different components, technologies and protocols working together.
In this tutorial/course we look at the fundamentals of how computers communicate on a TCP/IP network.
The tutorial is geared for those who need to learn the basics of how networks work, and how the components fit together so that they can set up a small home/office network.
In order for two computers to talk to each other they need:
- To be Connected (cable or Wireless) this is known as the connection media.
- To have a common language. in Networking this is known as a protocol.
- To have An Address.
Connecting Computers Together
Early computer networks used cable to connect computers together in a wired network.
Most modern networks use wireless (wi-Fi) as the main connection media and networks tend to be a mixture of wired and wireless.
The diagram below shows a wired Ethernet network. To work each device must be connected to a Ethernet hub or switch.
However logically they are all connected together and share the same media which we see later.
For a Wireless network the devices must connect to a wire access point as shown in the diagram below.
However,again logically they share and compete for access to the same media.
Wireless access usually have an Ethernet hub built in which allows them to connect to the wired Ethernet network.
In order to communicate with each other each computer needs to have a unique address.
This address is called the MAC (media access control address) and is built into the network card.
The address is also often called the physical address and the Ethernet address.
It is 48 bits long (new format is 64 bits) and is fixed by the manufacturer i.e. cannot be changed. (see Note 1).
It is shown as 6 hexadecimal numbers separated by colons e.g.
On Windows open a cmd prompt– Start menu run enter cmd and return.
Enter ipconfig /all into the window and hit return.
Notice windows using a dash – as a delimiter.
Note 1: On modern network cards it is possible for MAC addresses to be manually assigned, but it is not normal to do so. In addition 64 bit MAC addresses are now used.
Links and Networks
Ethernet is a data link protocol. Also known as a level 2 protocol on the OSI and TCP/IP networking models.
It is possible for computers to talk to each other using just Ethernet, and with no networking protocol, but it is not practical
You can liken a link to a street. Streets have houses and houses have numbers.
An Ethernet link (the street) has computers (houses) which in turn have numbers (Ethernet, Mac Address or Physical Address) .
However you can have many streets and the streets are connected. (crossroads, roundabouts etc ) to form a network of streets.
Routers divide out Ethernet links into networks.
All modern networks (home, office, corporate and the Internet) use the TCP/IP networking protocols.
The Networking protocol also has addresses (IP address), and these addresses are not fixed but assigned by a network administrator or automatically using a service called DHCP (Dynamic host Configuration protocol).
Ethernet Broadcasts, Broadcast Domains and Collisions
To send a message to all computers on an Ethernet network a broadcast address (Mac Address of all ones) is used. So
is the broadcast MAC address in Hex. See Understanding binary numbers
The broadcast domain is the effective range of the broadcast, which can be limited by inserting level 3 (IP level) network devices e.g. routers.
A broadcast will be re-transmitted by hubs, switches, bridges (level 2) and repeaters (level 1).
Note: Levels are the levels in the 7 layer OSI data model. See understanding the TCP/IP networking Model
Level 1 = physical e.g. media i.e. cable devices = Repeater
Level 2 = Data Link= Ethernet -devices are hubs,switches and bridges
Level 3= Network= IP protocol – devices are routers
A collision domain is the section of a network where packets can collide, and interfere with each other.
Network devices (Bridges and switches) working at level 2 (data link layer) can create separate collision domains.
Even though bridges and switches divide a network into separate collision domains, the computers are still part of the same broadcast domain.
This is shown in the diagram below.
Devices on the left of the bridge/switch can communicate with each other, and not affect devices on the right of he switch and vice versa.
However a broadcast will be seen by devices on both sides of the switch.
Bridges vs Switches
Bridges and switches do very similar functions and today you can only buy switches.
Bridges were used to join network segments i.e. LAN to LAN, whereas switch connected devices.
Hubs vs Switches
Hubs operate at the physical level, and were once the primary mechanism for connecting computers together.
Hubs do not create a separate collision domain they just repeat packets.
They have been replaced by switches.
If you look on Amazon for a hub it will be a switch.
This Cisco video explains the difference in more detail
Data Frames and Packets
Data is transferred between computers in data frames or packets.
The term frame is used for data units at the data link level and the the term packet for data units and the networking level.
Hence we have Ethernet frames and IP packets.
The data frame contains data and frame management information.
The concept used to describe data frames is that of a letter and envelope.
The letter is the data which is placed inside an envelope that contains the addressing information.
This concept of data being inserted into an envelope is used repeatedly in data communications, and it is an important one to grasp.
Although the Ethernet protocol alone is sufficient to get data between two nodes on an Ethernet network, it is not used on its own.
Ethernet represents what is known as a data link protocol, and for networking we need a networking protocol which in our case is IP (internet protocol).
Again the IP protocol is not used in isolation, but as part of a protocol suite called TCP/IP.
It is however the IP protocol which contains the important IP addresses, which are used for connecting computers together across the Internet, and in local networks.
The diagram below illustrates how data is placed inside protocol envelopes (headers).
At the receiving end it is unpacked in the reverse order.
Every device attached to your home network has an IP address, but what is a IP address? and why is it needed?
The IP address is the most important address as far as we are concerned, as it is a logical address, meaning it is assigned by us, and can be changed.
Current networks use IPv4 Addresses. IPv6 Addresses are being introduced but are unlikely to impact home/small office networks for a number of years.
The IP (IPv4) address is a 32 bit address and is written in dotted decimal notation and appears like this:
The address has four components each component is separated by a dot(.). So it is of this form:
For home/small office networks it isn’t really important to understand the different address classes (a,b,c,d etc) or the technicalities of sub netting as IP addresses are usually auto assigned.
When troubleshooting network problems you will need to be able to identify network addresses, and if a device has one, and whether that address is valid.
Because home/small office networks use a device called a NAT router ) the IP addresses used on almost all home networks is a non routeable IP address starting with 192.
This IP address is auto assigned by a DHCP server which is part of the NAT router.
Problems arise when clients are unable to get an IP address from the DHCP server because of network/router problems.
If a client cannot get an IP address then some clients will auto assign an IP address. from a reserved range 169.254.0.0-169.254.255.255 or simply have an IP address of 0.0.0.0.
Note: Different versions of windows use different default IP addresses
In either case it is unlikely to work correctly because clients with a 192. address are on a different network to clients with a 168. address, even though they may be next to each other on the same physical cable.
In our street analogy they think they are on different streets.
Finding Your IP Address
To find the IP address on a windows computer using ipconfig, open a command line (dos prompt) and type the command ipconfig at the prompt.
The following is displayed
Note: Click start>run and enter cmd in the text box to open a command prompt
Note: You may have more than one network address if you have multiple network cards installed.
The IP address here is 192.168.1.3 . You will also see the default gateway address (192.168.1.1). This is the IP address of the Router, the term gateway is an old Unix expression that is still used.
IP Addresses,Mac Addresses and ARP
To send an IP packet to a network device the sender needs to know the IP address of the destination device.
The IP address will be used to get the data packet to the final network segment.
In order to deliver the packet to the final destination the MAC address of the destination computer must be known.
A protocol know as ARP (address resolution protocol) is used, which uses an Ethernet broadcast to query the nodes on the network. The query is basically:
Which node has the IP address (Destination IP address). Send me your MAC address.
All nodes see the query but only the node with the destination IP address replies.
Computers and other devices can be grouped together into networks.
In the real world this is the same as houses are grouped together into streets.
Each network will have a unique network number and and will be the same for all computers/devices on that network.
To separate devices into networks a router is required.
On home/small office networks only one router is usually present, and it connects your home network to the Internet.
Network numbers are part of the IP address.
So when you look at an IP address what you see is a number with two components. A network component and a node component
It is the job of the Subnet mask to split the IP address into the network component and the Node component (device address).
For my network my computer has an IP address of 192.168.1.69 and a Subnet mask of 255.255.255.0.
To find the network address you do a logical AND of the two numbers.
This gives a network number of 192.168.1.0 and a node number of .0.0.0.69.
To verify use the simple AND rules
0 AND 0=0
0 AND 1=0
1 AND 0=0
1 AND 1=1
So number logical AND with 255 (all 1s) = the number
And number logical AND with 0 (all 0s) = 0
IPv4 is common on most networks today but it is slowly being replaced by IPv6.
What’s missing from this tutorial? What isn’t properly explained? Let me know using the comments section below and help me improve this course.
Related Articles and Resources
- Basic networking concepts -tutorial covers basic concepts like peer to peer networking etc
- Setup and Build a home or small office network
- Home Network Addressing
- Understanding DHCP
- Understanding DNS
- Internet and Networking Components– Common components of the home network.
- Useful Windows networking Commands