A basic knowledge about Internetworking is extremely important if you want to learn ethical hacking. As you progress and want to go deeper it is advisable to learn more about networking. Ethical hacking and internetworking is very closely associated. As you progress through this book you will find words like “packet”, “switch”, “router”, “modem”, “TCP/IP”, “OSI” and many more.
The very first thing you need to know is: data travel through many layers. Ethical hackers try to understand these layers. Once they have understood the movement they either want to track and block the data or they want to retrieve data.
In this chapter we would very briefly see how internetworking models work. We
will look into the different types of networking models. We will also know about the devices that comprise a network.
# What Does Network Mean?
A Network is a collection of devices that are connected through media. One of the main characteristics of a network is: devices contain services and resources. Devices contain Personal Computers, switches, routers and servers among others. What they do basically? They send data and get data either by switching or by routing. Actually they connect users so that users ultimately get full data instead of getting it by pieces. So the basic services these devices provide include switching, routing, addressing and data access.
We can conclude that a network primarily connects users to avail these services. That is its first job. The second job is also very important. A network always maintains a system so that the devices allow the users to share the resources more efficiently.
Now a problem arises. Not a trivial problem is this. Hardware and software manufacturers don’t know each other. They belong to different countries and share diverse cultures. When the conception of networking first came into the fore it was found that hardware and software weren’t matching. As I said before a network is a collection of devices. These devices are mainly built of hardware and software that are talking in different languages.
To solve this problem a common network model with communication functions is needed so that dissimilar devices can interoperate.
The importance of internetworking models consists of few main concepts. First they encourage interoperability. Second they provide a reference through which data will be communicated. Third they facilitate modular engineering.
There are two types of internetworking models.
They are Open Systems Interconnection (OSI) reference model and Transmission Control Protocol/Internet Protocol (TCP/IP) model. Both models are widely used today.
The Open Systems Interconnection (OSI) reference model was developed by the Internet Standards Organization (ISO) and it has seven layers in all. The layers are as follows: application (layer 7), presentation (layer 6), session (layer 5), transport (layer 4), network (layer 3), data link (layer 2) and physical (layer 1).
Let us very briefly try to understand how this model works. Suppose a user tries to open a web page. The very first thing he does is sending a request to the server that is located several thousand miles away. Here the server’s hard disk or hardware is the last layer (layer 1) which is termed as “physical”. So user’s request first knocks the “application” layer (7) which is the nearest and then it proceeds. Every process in each layer involves a complicated “bits and bytes” functioning. A Computer only understands 0 and 1. But the user does not love to see a video in 0 and 1.
Let us break the process in more detail.
In the application layer (7) user interacts with the device that could be a personal computer or smart phone or anything you might guess. So the application layer basically handles the user’s interaction. The name of datagram is “data”. The user requests for the data and ultimately retrieves the data. What happens when the user sends requests from the layer 7? It enters into the next layer (6) presentation. The process of encapsulation starts. Data is formatted and encrypted. Next the layer 5 or session enters into the scene. This layer manages end to end communication. Suppose you type a password and log into your social media account. This layer maintains the end to end (user to server) communication so that you can remain logged into your page. Till this layer the name of datagram is “data”.
To assist you to maintain your session the next three layers work very hard. They are transport (layer 4), network (layer 3), data link (layer 2) respectively. The name of the datagram of transport layer is “segment”. Why this is called “segment”? It is such called because it breaks your request into several fractions. First it adds source and destination port numbers. Next it tries to make it reliable adding sequence numbers. So in a nutshell it provides flow control, sequencing and reliability.
What happens next?
Your request enters into the layer 3 that is called network. The name of datagram is “packet”. It adds source and destination IP addresses. It also looks after so that your request finds the best path to reach the destination.
Now your data request almost reaches the final stage. It enters into the layer 2 that is data link. It is nearing the end point that is server’s hardware. So this layer adds source and destination Media Access Control (MAC) addresses. Next it goes through Frame Check System (FCS) processes. It checks frame by frame whether the source requests reach the right destination. That is why the datagram is known as “frame”.
Now it has entered into the final destination that is layer 1 or physical. There are only bits over the physical medium. The name of the datagram is “bits and bytes”.
Now we can imagine a small office with one router, two switches and few desktops, laptops, printers and servers. The router is connected to the switches and the switches are connected to the devices like desktops, laptops, printers and servers. Here desktops, laptops, printers and servers belong to the layer 1 that is physical. The switches belong to the layer 2 that is data link and the router fits in the layer 3 that is network.
Routers are layer 3 devices and perform few definite tasks. They are packet switching, packet filtering, and path selecting and finally communicating. The task of packet switching involves the process of getting a packet to the next device. Here the next device is the switches. Packet filtering suggests in its name what it actually does. It either permits or blocks packets depending on certain criteria. Path selecting is determining the best path through the network to the destination. Communication is another important part of this layer. Routers communicate with other networks like Internet.
Between routers, layer 3 devices, and the end application physical, layer 1 devices there are switches which are layer 2 devices. In some cases switches perform the task of layer 3 devices. Switches basically deal with frame filtering and forwarding. It also maintains the connection between layer 3 and layer 1.