Skip to content

Instantly share code, notes, and snippets.

@fourohfour
Last active June 4, 2016 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourohfour/0200b0e6708c2ccc9ccbfd32e3afe31c to your computer and use it in GitHub Desktop.
Save fourohfour/0200b0e6708c2ccc9ccbfd32e3afe31c to your computer and use it in GitHub Desktop.

#MAC and IP Addresses, and the OSI Model

One of the most advanced concepts in the GCSE Computing course is IP and MAC Addresses; specifically the differences between them and their differing usages. To understand them, it is helpful to learn about the OSI Model of Computer Networking; although this is an A-Level concept it forms the foundations for an understanding of what IP and MAC Addresses are and what they do.

Computer Networks are managed by a series of Protocols. A Protocol can best be thought of as a sort of rulebook. A football team from Brazil can play one from China - although they are geographically distant, they are both following the same Protocol, as such. Here are some of the more well known protocols:

Layer 5

HTTP (HyperText Transfer Protocol, for webpages)

FTP (File Transfer Protocol, for files)

IMAP (Internet Message Access Protcol, for email)

Layer 4

TCP (Transmission Control Protocol, used for the world-wide-web and most other online services)

UDP (User Datagram Protocol, used mostly for continuous streams of data such as Skype calls)

Layer 3

IP (Internet Protocol, v4 and v6)

Layer 2 and 1

Ethernet (802.3, wired LANs and MANs)

USB (Universal Serial Bus, connecting peripherals)

Bluetooth (Short range wireless networking)

Wi-Fi (Officially known as 802.11, for wireless LANs)

You do not need to memorise all of these protocols. If you know what HTTP, TCP, IP and Ethernet are you will be more than prepared for the exam. You will see that these protocols are categorised into four groups, or layers. In the traditional OSI Model, there are five layers, but I have merged layers 1 and 2 for the sake of clarity. The protocols in each layer share the similarity that they operate at the same level of abstraction. This is a tricky concept to explain, but the key idea is that the lower the levels go, the closer to the actual physical hardware - the cables and modems, the transmitters and recievers - the protocols operate.

At Level 5, the protocols don't care how the data is transmitted - but instead manage what the data actually is. This is known as the application layer. For example, HTTP controls the signals that the client (i.e. your computer) and the server which hosts the webpage. A client computer will send what is known as a GET request, and recieves a response (ex. '404 File not Found'). As far as Level 5 protocols are concerned, the data could be transported by carrier pidgeon.

At Level 4, the protocols don't care about the network the data is transmitted over; only how it is transmitted. This is known as the transport layer. Protocols such as TCP ensure that no data is lost and that the data is reliable and in the correct order when it is recieved. Again, the actual network itself is not of importance - from the point of view of a Level 4 protocol the data is being transmitted over a single cable directly from the destination to the reciever with no routers or servers in the middle.

At Level 3, the protocols don't care about the medium the data is transmitted over - be it fibre-optic cable or wi-fi or telephone lines. The Level 3 protocols do, however, manage the actual delivery of data across a network. Level 3 is known as the Internet Layer. The key protocol at this layer is IP, the Internet Protocol. This protocol assigns each computer on the network an IP address. It then controls the routing of the packets across the network. The key thing to know about IP Addresses is that they are not bound to a specific machine. If you reboot your router, you can often be assigned a different IP address from your ISP to the one you had before (this is one way of circumventing IP bans from video games). IPs are loosly hierachial; each number further sub-divides the network. For example, all IPs starting with 17 are assigned to Apple Inc. for their networks. At Level 3, the network is still quite an abstract concept - a set of nodes connected by lines. The medium by which a connection is made is not relevant. There are many benefits to this abstract approach. If I replace an old server with a new one, I can still use the old IP Address, as IP addresses are not permanently bound to a single machine.

At Level 2 and 1, the protocols are dealing with the actual hardware of the network. Different protocols are used for different types of connection. Computers, or endpoints, are recognised by their MAC Addresses. MAC Addresses are hardcoded into Network Cards - the parts of devices which allow them to connect to the internet - at the factory. People often wonder why we need to use Level 3 IP Addresses when Level 2 already assigns a unique MAC Address to each device. There are several key reasons for this. Firstly, Level 3 protocols such as IP do not necessarily need to run on top of networks which use MAC Addresses. IP could theoretically run on top of the london underground, with the data being carried in envelopes by the train drivers. Obviously this is ridiculous but it illustrates how abstraction layers allow new technology to evolve without having to completely re-write the internet. There are other issues with MAC Addresses. Although they are theoretically unique, manufacturers of network cards have been known to accidentally assign the same address to many devices. Furthermore, it is relatively easy to 'spoof' or fabricate one's MAC address, which could be a security issue were MAC addresses used instead of IP addresses. A final issue with using MAC addresses is that they are not hierachial in the same way that IP addresses are. 00:A0:C9:14:C8 could be in Japan, while 00:A0:C9:14:C9 could be in Argentina. We can divide networks based on their IP addresses quite logically and easily; this is known as subnetting. This would not be possible with MAC Addresses.

So what's the point in MAC Addresses at all? Well, they are necessary, and I can illustrate this by way of an analogy.

Imagine a city in which every door has a unique serial number printed on it. Most of the time people ignore this serial number, and send letters based on ordinary addresses. '99 Waterfall Street' is logical and easy for the postman; he can easily find Waterfall street and then simply walk along it to find number 99. This address is like an IP address. However, now imagine a new street is built. All the houses have serial numbers on their doors, which were printed on in the door factory. The builders who built the road can uniquely identify all the houses based on their serial number; which you might have guessed is analogous to the MAC Address. However, how does one send a letter to a house on this new street; for it does not yet have addresses from the perspective of the outside world? The procedure is simple. The builders decide to call the street 'Green Street', and they give each house a number. They create a list of house numbers and corresponding door serial numbers, and use this list to nail the house numbers onto each door. Now the postman can deliver to '11 Green Street' without ever having to worry about the serial numbers on the doors.

This analogy is by no means perfect, but illustrates the seperate purposes of IP and MAC addresses.

Here is a slightly more advanced, but (IMO) much better explanation. http://superuser.com/a/623648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment