Starting Data link layer

main
lomna-dev 1 year ago
parent d6c895778e
commit a2b53102ee

@ -0,0 +1 @@
* Data Link Layer

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2023-08-13 Sun 18:07 --> <!-- 2023-08-16 Wed 21:42 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Computer Networks</title> <title>Computer Networks</title>
@ -223,88 +223,100 @@
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc"> <div id="text-table-of-contents" role="doc-toc">
<ul> <ul>
<li><a href="#orgc817192">1. Introduction</a> <li><a href="#org9cd6467">1. Introduction</a>
<ul> <ul>
<li><a href="#org8b0988f">1.1. Some basic terminologies</a></li> <li><a href="#org99c8429">1.1. Some basic terminologies</a></li>
<li><a href="#org97c4ecf">1.2. OSI Model</a></li> <li><a href="#orgbdddc58">1.2. OSI Model</a></li>
<li><a href="#org7d2a184">1.3. Unique Identifiers of Computer Network</a> <li><a href="#orgb773ee3">1.3. Unique Identifiers of Computer Network</a>
<ul> <ul>
<li><a href="#org937ed0e">1.3.1. Hostname</a></li> <li><a href="#orga76425d">1.3.1. Hostname</a></li>
<li><a href="#orge96f0ab">1.3.2. IP Address</a></li> <li><a href="#org98ea7f8">1.3.2. IP Address</a></li>
<li><a href="#org0fac76a">1.3.3. MAC Address</a></li> <li><a href="#org466e87f">1.3.3. MAC Address</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgd914f51">1.4. Ports</a></li> <li><a href="#org514db7d">1.4. Ports</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgd05cac5">2. Network Models</a> <li><a href="#org0164d60">2. Network Models</a>
<ul> <ul>
<li><a href="#orgf759d6d">2.1. OSI Model</a> <li><a href="#orga1167d7">2.1. OSI Model</a>
<ul> <ul>
<li><a href="#org4cd06e1">2.1.1. Physical Layer</a></li> <li><a href="#org819ca22">2.1.1. Physical Layer</a></li>
<li><a href="#org915ce23">2.1.2. Data Link Layer (DLL)</a></li> <li><a href="#orga69c543">2.1.2. Data Link Layer (DLL)</a></li>
<li><a href="#org390e6d9">2.1.3. Network Layer</a></li> <li><a href="#org8b391d0">2.1.3. Network Layer</a></li>
<li><a href="#org248ab02">2.1.4. Transport Layer</a></li> <li><a href="#orgcf1456f">2.1.4. Transport Layer</a></li>
<li><a href="#org2cc6adf">2.1.5. Session Layer</a></li> <li><a href="#orgf2393f7">2.1.5. Session Layer</a></li>
<li><a href="#org868134c">2.1.6. Presentation Layer</a></li> <li><a href="#org1b35043">2.1.6. Presentation Layer</a></li>
<li><a href="#orgc2951bf">2.1.7. Application Layer</a></li> <li><a href="#org1c6166f">2.1.7. Application Layer</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgbb9736a">2.2. TCP/IP Model</a> <li><a href="#orge2048ce">2.2. TCP/IP Model</a>
<ul> <ul>
<li><a href="#org8e59a04">2.2.1. Link layer</a></li> <li><a href="#org3bd3f00">2.2.1. Link layer</a></li>
<li><a href="#orgc7329cd">2.2.2. Internet layer</a></li> <li><a href="#org282a19f">2.2.2. Internet layer</a></li>
<li><a href="#org3939715">2.2.3. Transport layer</a></li> <li><a href="#org77e944a">2.2.3. Transport layer</a></li>
<li><a href="#orgd1fdc6e">2.2.4. Application layer</a></li> <li><a href="#orga2a23d3">2.2.4. Application layer</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#org926f366">3. Physical Layer</a> <li><a href="#org51c9d06">3. Physical Layer</a>
<ul> <ul>
<li><a href="#orge13f2a6">3.1. Network Topology</a> <li><a href="#org24f4493">3.1. Network Topology</a>
<ul> <ul>
<li><a href="#org590851d">3.1.1. Point-to-Point</a></li> <li><a href="#org1fd355c">3.1.1. Point-to-Point</a></li>
<li><a href="#orgcf84d77">3.1.2. Daisy chaining</a></li> <li><a href="#org73d1586">3.1.2. Daisy chaining</a></li>
<li><a href="#orgc532534">3.1.3. Mesh topology</a></li> <li><a href="#orgf3edb1f">3.1.3. Mesh topology</a></li>
<li><a href="#org1b9f69f">3.1.4. Star topology</a></li> <li><a href="#org2a440e7">3.1.4. Star topology</a></li>
<li><a href="#org1907211">3.1.5. Bus topology</a></li> <li><a href="#org6bdd66c">3.1.5. Bus topology</a></li>
<li><a href="#orga8ae853">3.1.6. Ring topology</a></li> <li><a href="#org994566e">3.1.6. Ring topology</a></li>
<li><a href="#orgf3a5902">3.1.7. Tree topology</a></li> <li><a href="#org2951587">3.1.7. Tree topology</a></li>
<li><a href="#org0e63ae0">3.1.8. Hybrid topology</a></li> <li><a href="#org3009196">3.1.8. Hybrid topology</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org0dba01c">3.2. Digital Modulation</a> <li><a href="#orga8b833b">3.2. Digital Modulation</a>
<ul> <ul>
<li><a href="#org624aef0">3.2.1. Bandwidth and maximum data rate</a> <li><a href="#orga6decfd">3.2.1. Bandwidth and maximum data rate</a>
<ul> <ul>
<li><a href="#orgc8f1c5d">3.2.1.1. Maximum data rate for noiseless wires</a></li> <li><a href="#orge836a41">3.2.1.1. Maximum data transfer rate for noiseless wires</a></li>
<li><a href="#org37ba939">3.2.1.2. Maximum data rate for noisy wires</a></li> <li><a href="#org74f8800">3.2.1.2. Maximum data transfer rate for noisy wires</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org7cd3557">3.2.2. Non-Return to Zero (NRZ)</a></li> <li><a href="#org709c85f">3.2.2. Non-Return to Zero (NRZ)</a></li>
<li><a href="#org830f4d4">3.2.3. Increasing bandwidth efficiency by symbols</a></li> <li><a href="#orgba47841">3.2.3. Increasing bandwidth efficiency by symbols</a></li>
<li><a href="#org8cf77b3">3.2.4. Clock recovery</a> <li><a href="#org2e0dad5">3.2.4. Clock recovery</a>
<ul> <ul>
<li><a href="#org3c39be8">3.2.4.1. Manchester encoding</a></li> <li><a href="#org83e35b9">3.2.4.1. Manchester encoding</a></li>
<li><a href="#org85693d2">3.2.4.2. Non-Return-to-Zero Inverted (NRZI)</a></li> <li><a href="#orgfc45c3c">3.2.4.2. Non-Return-to-Zero Inverted (NRZI)</a></li>
<li><a href="#org27a7f54">3.2.4.3. 4B/5B</a></li> <li><a href="#org0dcf6ae">3.2.4.3. 4B/5B</a></li>
<li><a href="#org51fae35">3.2.4.4. Scrambling</a></li> <li><a href="#orge986a37">3.2.4.4. Scrambling</a></li>
</ul>
</li>
<li><a href="#orgcb6a702">3.2.5. Balanced signals</a>
<ul>
<li><a href="#orgb52d16a">3.2.5.1. Alternate Mark Inversion (AMI)</a></li>
<li><a href="#org3509b66">3.2.5.2. 8B/10B</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgf219134">3.2.5. Balanced signals</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgba83308">3.3. Switching</a>
<ul>
<li><a href="#org08c9017">3.3.1. Circuit switching</a></li>
<li><a href="#org8ace8aa">3.3.2. Packet switching</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li>
<li><a href="#org571cce0">4. Data Link Layer</a></li>
</ul>
</div> </div>
</div> </div>
<p> <p>
<hr /> <hr />
</p> </p>
<div id="outline-container-orgc817192" class="outline-2"> <div id="outline-container-org9cd6467" class="outline-2">
<h2 id="orgc817192"><span class="section-number-2">1.</span> Introduction</h2> <h2 id="org9cd6467"><span class="section-number-2">1.</span> Introduction</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
A computer network is collection of two or more computers that can communicate with each other. A computer network is collection of two or more computers that can communicate with each other.
@ -322,8 +334,8 @@ Computer networks are made of protocols which allow us to send data through link
<hr /> <hr />
</p> </p>
</div> </div>
<div id="outline-container-org8b0988f" class="outline-3"> <div id="outline-container-org99c8429" class="outline-3">
<h3 id="org8b0988f"><span class="section-number-3">1.1.</span> Some basic terminologies</h3> <h3 id="org99c8429"><span class="section-number-3">1.1.</span> Some basic terminologies</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<p> <p>
Here, we will look at basic terminologies used in computer networks. Most of these will be expanded on further. Here, we will look at basic terminologies used in computer networks. Most of these will be expanded on further.
@ -356,8 +368,8 @@ Computer networks can fall under two broad categories
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org97c4ecf" class="outline-3"> <div id="outline-container-orgbdddc58" class="outline-3">
<h3 id="org97c4ecf"><span class="section-number-3">1.2.</span> OSI Model</h3> <h3 id="orgbdddc58"><span class="section-number-3">1.2.</span> OSI Model</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<p> <p>
OSI stands for Open Systems Interconnection. It is a reference model which specifies standards and communication protocols for computer network. It is a 7 layer architecture. Each layer has different functions and protocols. The seven layers are OSI stands for Open Systems Interconnection. It is a reference model which specifies standards and communication protocols for computer network. It is a 7 layer architecture. Each layer has different functions and protocols. The seven layers are
@ -377,31 +389,31 @@ We don't use the OSI Model and mostly use it as a referencial model. The TCP/IP
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org7d2a184" class="outline-3"> <div id="outline-container-orgb773ee3" class="outline-3">
<h3 id="org7d2a184"><span class="section-number-3">1.3.</span> Unique Identifiers of Computer Network</h3> <h3 id="orgb773ee3"><span class="section-number-3">1.3.</span> Unique Identifiers of Computer Network</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<p> <p>
In order to establish communication between two nodes, we need to identify the nodes. This is done by using unique identifiers given to devices on a network. In order to establish communication between two nodes, we need to identify the nodes. This is done by using unique identifiers given to devices on a network.
</p> </p>
</div> </div>
<div id="outline-container-org937ed0e" class="outline-4"> <div id="outline-container-orga76425d" class="outline-4">
<h4 id="org937ed0e"><span class="section-number-4">1.3.1.</span> Hostname</h4> <h4 id="orga76425d"><span class="section-number-4">1.3.1.</span> Hostname</h4>
<div class="outline-text-4" id="text-1-3-1"> <div class="outline-text-4" id="text-1-3-1">
<p> <p>
A hostname is a human readable label that is assigned to a device on the network. On the internet, a hostname is a domain name which has been assigned to a host computer. It is useful to identify devices on a local network. A hostname is a human readable label that is assigned to a device on the network. On the internet, a hostname is a domain name which has been assigned to a host computer. It is useful to identify devices on a local network.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-orge96f0ab" class="outline-4"> <div id="outline-container-org98ea7f8" class="outline-4">
<h4 id="orge96f0ab"><span class="section-number-4">1.3.2.</span> IP Address</h4> <h4 id="org98ea7f8"><span class="section-number-4">1.3.2.</span> IP Address</h4>
<div class="outline-text-4" id="text-1-3-2"> <div class="outline-text-4" id="text-1-3-2">
<p> <p>
Also known as the logical address, every device to which a direct communication can be established will have a unique IP address. Interned Assigned Numbers Authority (IANA) assigns and manages ip addresses globally. Previously, ipv4 (version 4) was used and was an address of 32 bits, hence there are \(2^{32}\) unique ipv4 addresses. Because there are limited number of ipv4 addresses, we are running out of them. A new version of ip addresses ipv6 is now implemented. It has addresses of size 128 bits. Also known as the logical address, every device to which a direct communication can be established will have a unique IP address. Interned Assigned Numbers Authority (IANA) assigns and manages ip addresses globally. Previously, ipv4 (version 4) was used and was an address of 32 bits, hence there are \(2^{32}\) unique ipv4 addresses. Because there are limited number of ipv4 addresses, we are running out of them. A new version of ip addresses ipv6 is now implemented. It has addresses of size 128 bits.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org0fac76a" class="outline-4"> <div id="outline-container-org466e87f" class="outline-4">
<h4 id="org0fac76a"><span class="section-number-4">1.3.3.</span> MAC Address</h4> <h4 id="org466e87f"><span class="section-number-4">1.3.3.</span> MAC Address</h4>
<div class="outline-text-4" id="text-1-3-3"> <div class="outline-text-4" id="text-1-3-3">
<p> <p>
Stands for Media Access Control Address. It is also known as the physical address. Every Network Interface Card (NIC) is assigned a unique identifier. These are assigned by the manufacturer and cannot be changed. The length of a MAC address is 48 bits. Stands for Media Access Control Address. It is also known as the physical address. Every Network Interface Card (NIC) is assigned a unique identifier. These are assigned by the manufacturer and cannot be changed. The length of a MAC address is 48 bits.
@ -410,8 +422,8 @@ Stands for Media Access Control Address. It is also known as the physical addres
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgd914f51" class="outline-3"> <div id="outline-container-org514db7d" class="outline-3">
<h3 id="orgd914f51"><span class="section-number-3">1.4.</span> Ports</h3> <h3 id="org514db7d"><span class="section-number-3">1.4.</span> Ports</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<p> <p>
A single system has multiple connections and network applications running. A port is a logical channel through which data can be sent or recieved. A port number is always associated with a network address such as an IP address so that we can identify the device whose port was referenced. The unique combination of ip address and port number together is called a <b>socket</b>, example 192.168.0.1:8000 A single system has multiple connections and network applications running. A port is a logical channel through which data can be sent or recieved. A port number is always associated with a network address such as an IP address so that we can identify the device whose port was referenced. The unique combination of ip address and port number together is called a <b>socket</b>, example 192.168.0.1:8000
@ -469,8 +481,8 @@ The ports are divided into three categories.
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgd05cac5" class="outline-2"> <div id="outline-container-org0164d60" class="outline-2">
<h2 id="orgd05cac5"><span class="section-number-2">2.</span> Network Models</h2> <h2 id="org0164d60"><span class="section-number-2">2.</span> Network Models</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
A network model defines a way to organize a system's functions and features. It also defines it's structure and protocols. A network model defines a way to organize a system's functions and features. It also defines it's structure and protocols.
@ -499,8 +511,8 @@ There have been many network models, many of them are no longer used. IBM's SNA
<hr /> <hr />
</p> </p>
</div> </div>
<div id="outline-container-orgf759d6d" class="outline-3"> <div id="outline-container-orga1167d7" class="outline-3">
<h3 id="orgf759d6d"><span class="section-number-3">2.1.</span> OSI Model</h3> <h3 id="orga1167d7"><span class="section-number-3">2.1.</span> OSI Model</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-2-1">
<p> <p>
TODO : Add OSI model image TODO : Add OSI model image
@ -518,8 +530,8 @@ The OSI model has 7 layers. Each layer has different functionality. The principl
<li>The number of layers should be large enough that distinct functions need not be in same layer, but small enough that architecture is not unwieldy</li> <li>The number of layers should be large enough that distinct functions need not be in same layer, but small enough that architecture is not unwieldy</li>
</ol> </ol>
</div> </div>
<div id="outline-container-org4cd06e1" class="outline-4"> <div id="outline-container-org819ca22" class="outline-4">
<h4 id="org4cd06e1"><span class="section-number-4">2.1.1.</span> Physical Layer</h4> <h4 id="org819ca22"><span class="section-number-4">2.1.1.</span> Physical Layer</h4>
<div class="outline-text-4" id="text-2-1-1"> <div class="outline-text-4" id="text-2-1-1">
<p> <p>
The lowest layer of the OSI model. Responsible for physical connections between the devices. The physical layer handles data in form of bits and is responsible for transmitting bits without loss from one node to another. The lowest layer of the OSI model. Responsible for physical connections between the devices. The physical layer handles data in form of bits and is responsible for transmitting bits without loss from one node to another.
@ -540,8 +552,8 @@ Hub, repeater, moden and cables are physical layer devices
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org915ce23" class="outline-4"> <div id="outline-container-orga69c543" class="outline-4">
<h4 id="org915ce23"><span class="section-number-4">2.1.2.</span> Data Link Layer (DLL)</h4> <h4 id="orga69c543"><span class="section-number-4">2.1.2.</span> Data Link Layer (DLL)</h4>
<div class="outline-text-4" id="text-2-1-2"> <div class="outline-text-4" id="text-2-1-2">
<p> <p>
This layer is responsible for node-to-mode delivery of the message. It makes sure that data transfer is error-free from one node to another, over the physical layer. When packet enters a network, it is the responsibility of DLL to transmit it to the host using MAC address. This layer is responsible for node-to-mode delivery of the message. It makes sure that data transfer is error-free from one node to another, over the physical layer. When packet enters a network, it is the responsibility of DLL to transmit it to the host using MAC address.
@ -576,8 +588,8 @@ Switch and bridges are example of DLL devices.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org390e6d9" class="outline-4"> <div id="outline-container-org8b391d0" class="outline-4">
<h4 id="org390e6d9"><span class="section-number-4">2.1.3.</span> Network Layer</h4> <h4 id="org8b391d0"><span class="section-number-4">2.1.3.</span> Network Layer</h4>
<div class="outline-text-4" id="text-2-1-3"> <div class="outline-text-4" id="text-2-1-3">
<p> <p>
The network layer controls operations of the subnet. The network layer controls operations of the subnet.
@ -605,8 +617,8 @@ The implementation of network layer is in devices such as routers and switches.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org248ab02" class="outline-4"> <div id="outline-container-orgcf1456f" class="outline-4">
<h4 id="org248ab02"><span class="section-number-4">2.1.4.</span> Transport Layer</h4> <h4 id="orgcf1456f"><span class="section-number-4">2.1.4.</span> Transport Layer</h4>
<div class="outline-text-4" id="text-2-1-4"> <div class="outline-text-4" id="text-2-1-4">
<p> <p>
The data in transport layer is referred to as <b>segments</b>. This layer is responsible for end to end delivery of messages. It also acknowledges successful transmission and re-transmits data if error is found. The data in transport layer is referred to as <b>segments</b>. This layer is responsible for end to end delivery of messages. It also acknowledges successful transmission and re-transmits data if error is found.
@ -645,8 +657,8 @@ Transport layer is operated by the OS. This layer is called the <b>heart of OSI
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org2cc6adf" class="outline-4"> <div id="outline-container-orgf2393f7" class="outline-4">
<h4 id="org2cc6adf"><span class="section-number-4">2.1.5.</span> Session Layer</h4> <h4 id="orgf2393f7"><span class="section-number-4">2.1.5.</span> Session Layer</h4>
<div class="outline-text-4" id="text-2-1-5"> <div class="outline-text-4" id="text-2-1-5">
<p> <p>
This layer is responsible for establishing connection, maintanance of communication sessions and authentication. It ensures the security in connection. This layer is responsible for establishing connection, maintanance of communication sessions and authentication. It ensures the security in connection.
@ -662,8 +674,8 @@ The services provided by session layer are
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-org868134c" class="outline-4"> <div id="outline-container-org1b35043" class="outline-4">
<h4 id="org868134c"><span class="section-number-4">2.1.6.</span> Presentation Layer</h4> <h4 id="org1b35043"><span class="section-number-4">2.1.6.</span> Presentation Layer</h4>
<div class="outline-text-4" id="text-2-1-6"> <div class="outline-text-4" id="text-2-1-6">
<p> <p>
Also called the translation layer. This layer translates files and data from local formats to standard, transmittable formats. Also called the translation layer. This layer translates files and data from local formats to standard, transmittable formats.
@ -681,8 +693,8 @@ The services provided by presentation layer are
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-orgc2951bf" class="outline-4"> <div id="outline-container-org1c6166f" class="outline-4">
<h4 id="orgc2951bf"><span class="section-number-4">2.1.7.</span> Application Layer</h4> <h4 id="org1c6166f"><span class="section-number-4">2.1.7.</span> Application Layer</h4>
<div class="outline-text-4" id="text-2-1-7"> <div class="outline-text-4" id="text-2-1-7">
<p> <p>
Also called the Desktop Layer. This layer acts as the window for applications to access the network. This layer produces the data which will be transferred over network and displays the information to user. This layer also contains the protocols for interfaces to different functionalities of the web. Also called the Desktop Layer. This layer acts as the window for applications to access the network. This layer produces the data which will be transferred over network and displays the information to user. This layer also contains the protocols for interfaces to different functionalities of the web.
@ -695,8 +707,8 @@ This layer has protocols such as HTTP, FTP, SMTP, DNS and provides the functiona
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgbb9736a" class="outline-3"> <div id="outline-container-orge2048ce" class="outline-3">
<h3 id="orgbb9736a"><span class="section-number-3">2.2.</span> TCP/IP Model</h3> <h3 id="orge2048ce"><span class="section-number-3">2.2.</span> TCP/IP Model</h3>
<div class="outline-text-3" id="text-2-2"> <div class="outline-text-3" id="text-2-2">
<p> <p>
TCP/IP was used in ARPANET and now the worldwide Internet. The ARPANET started as a network of hundreds of universities and government installations. When satellite and radio networks were added, they caused problems with existing protocols. This need for a model that can connect multiple networks in a seamless way was the major goal of the TCP/IP model. TCP/IP was used in ARPANET and now the worldwide Internet. The ARPANET started as a network of hundreds of universities and government installations. When satellite and radio networks were added, they caused problems with existing protocols. This need for a model that can connect multiple networks in a seamless way was the major goal of the TCP/IP model.
@ -711,8 +723,8 @@ The TCP/IP model had 4 layers, but sometimes physical layer is also included in
</p> </p>
</div> </div>
<div id="outline-container-org8e59a04" class="outline-4"> <div id="outline-container-org3bd3f00" class="outline-4">
<h4 id="org8e59a04"><span class="section-number-4">2.2.1.</span> Link layer</h4> <h4 id="org3bd3f00"><span class="section-number-4">2.2.1.</span> Link layer</h4>
<div class="outline-text-4" id="text-2-2-1"> <div class="outline-text-4" id="text-2-2-1">
<p> <p>
The requirnment for a robust network led to the choice of packet-switching network based on a connectionless layer that runs across different networks. The link layer describes what links like serial lines and classic ethernet must do to meet needs of this connectionless internet layer. It is not a layer in normal sense, but rather an interface between different hosts and transmission links. The requirnment for a robust network led to the choice of packet-switching network based on a connectionless layer that runs across different networks. The link layer describes what links like serial lines and classic ethernet must do to meet needs of this connectionless internet layer. It is not a layer in normal sense, but rather an interface between different hosts and transmission links.
@ -720,8 +732,8 @@ The requirnment for a robust network led to the choice of packet-switching netwo
</div> </div>
</div> </div>
<div id="outline-container-orgc7329cd" class="outline-4"> <div id="outline-container-org282a19f" class="outline-4">
<h4 id="orgc7329cd"><span class="section-number-4">2.2.2.</span> Internet layer</h4> <h4 id="org282a19f"><span class="section-number-4">2.2.2.</span> Internet layer</h4>
<div class="outline-text-4" id="text-2-2-2"> <div class="outline-text-4" id="text-2-2-2">
<p> <p>
This layer roughly corresponds to the OSI network layer. Its job is to permit hosts to <b>inject packets into any network and have them travel independently to the destination</b>. That is, it will allow packets from go to one network to another while they are going to destination. This property that packets can travel through any network makes the whole network more robust, by allowing communication even if a few networks in some path are down. This layer roughly corresponds to the OSI network layer. Its job is to permit hosts to <b>inject packets into any network and have them travel independently to the destination</b>. That is, it will allow packets from go to one network to another while they are going to destination. This property that packets can travel through any network makes the whole network more robust, by allowing communication even if a few networks in some path are down.
@ -744,16 +756,16 @@ The job of internet layer is to deliver IP packets where they are supposed to go
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org3939715" class="outline-4"> <div id="outline-container-org77e944a" class="outline-4">
<h4 id="org3939715"><span class="section-number-4">2.2.3.</span> Transport layer</h4> <h4 id="org77e944a"><span class="section-number-4">2.2.3.</span> Transport layer</h4>
<div class="outline-text-4" id="text-2-2-3"> <div class="outline-text-4" id="text-2-2-3">
<p> <p>
TODO : Here TODO : Here
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-orgd1fdc6e" class="outline-4"> <div id="outline-container-orga2a23d3" class="outline-4">
<h4 id="orgd1fdc6e"><span class="section-number-4">2.2.4.</span> Application layer</h4> <h4 id="orga2a23d3"><span class="section-number-4">2.2.4.</span> Application layer</h4>
<div class="outline-text-4" id="text-2-2-4"> <div class="outline-text-4" id="text-2-2-4">
<p> <p>
TODO : Here TODO : Here
@ -763,16 +775,16 @@ TODO : Here
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org926f366" class="outline-2"> <div id="outline-container-org51c9d06" class="outline-2">
<h2 id="org926f366"><span class="section-number-2">3.</span> Physical Layer</h2> <h2 id="org51c9d06"><span class="section-number-2">3.</span> Physical Layer</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
The lowest layer of the TCP/IP model. It describes the standard for the physical connections between nodes. It only views the data as a stream of bits and is concerned with transmission of bits without error. The lowest layer of the TCP/IP model. It describes the standard for the physical connections between nodes. It only views the data as a stream of bits and is concerned with transmission of bits without error.
<hr /> <hr />
</p> </p>
</div> </div>
<div id="outline-container-orge13f2a6" class="outline-3"> <div id="outline-container-org24f4493" class="outline-3">
<h3 id="orge13f2a6"><span class="section-number-3">3.1.</span> Network Topology</h3> <h3 id="org24f4493"><span class="section-number-3">3.1.</span> Network Topology</h3>
<div class="outline-text-3" id="text-3-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
The arrangement of nodes and links in a computer network is called network topology. There are various types of topologies The arrangement of nodes and links in a computer network is called network topology. There are various types of topologies
@ -782,24 +794,24 @@ The arrangement of nodes and links in a computer network is called network topol
TODO : Add images of network topology TODO : Add images of network topology
</p> </p>
</div> </div>
<div id="outline-container-org590851d" class="outline-4"> <div id="outline-container-org1fd355c" class="outline-4">
<h4 id="org590851d"><span class="section-number-4">3.1.1.</span> Point-to-Point</h4> <h4 id="org1fd355c"><span class="section-number-4">3.1.1.</span> Point-to-Point</h4>
<div class="outline-text-4" id="text-3-1-1"> <div class="outline-text-4" id="text-3-1-1">
<p> <p>
It is the simplest connection with two nodes and a single link between them. It is the simplest connection with two nodes and a single link between them.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-orgcf84d77" class="outline-4"> <div id="outline-container-org73d1586" class="outline-4">
<h4 id="orgcf84d77"><span class="section-number-4">3.1.2.</span> Daisy chaining</h4> <h4 id="org73d1586"><span class="section-number-4">3.1.2.</span> Daisy chaining</h4>
<div class="outline-text-4" id="text-3-1-2"> <div class="outline-text-4" id="text-3-1-2">
<p> <p>
Also called linear topology, the nodes are connected in a series. Message will follows the whole chain till it reaches the destination. If a link fails in this topology, it is hard to find it, therefore it is not good for large networks. Also called linear topology, the nodes are connected in a series. Message will follows the whole chain till it reaches the destination. If a link fails in this topology, it is hard to find it, therefore it is not good for large networks.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-orgc532534" class="outline-4"> <div id="outline-container-orgf3edb1f" class="outline-4">
<h4 id="orgc532534"><span class="section-number-4">3.1.3.</span> Mesh topology</h4> <h4 id="orgf3edb1f"><span class="section-number-4">3.1.3.</span> Mesh topology</h4>
<div class="outline-text-4" id="text-3-1-3"> <div class="outline-text-4" id="text-3-1-3">
<p> <p>
Every node is connected to another node through a direct link. In mesh topology, we use AHCP (Ad Hoc Configuration Protocol) and DHCP (Dynamic Host Configuration Protocol). Every node is connected to another node through a direct link. In mesh topology, we use AHCP (Ad Hoc Configuration Protocol) and DHCP (Dynamic Host Configuration Protocol).
@ -843,8 +855,8 @@ Mesh topology is of two types
</ol> </ol>
</div> </div>
</div> </div>
<div id="outline-container-org1b9f69f" class="outline-4"> <div id="outline-container-org2a440e7" class="outline-4">
<h4 id="org1b9f69f"><span class="section-number-4">3.1.4.</span> Star topology</h4> <h4 id="org2a440e7"><span class="section-number-4">3.1.4.</span> Star topology</h4>
<div class="outline-text-4" id="text-3-1-4"> <div class="outline-text-4" id="text-3-1-4">
<p> <p>
All nodes are connected to a central node (called the hub) through links. Hubs are not communication endpoints, their function is to forward packets across all ports. The hubs can either be passive in nature or active. All nodes are connected to a central node (called the hub) through links. Hubs are not communication endpoints, their function is to forward packets across all ports. The hubs can either be passive in nature or active.
@ -874,8 +886,8 @@ Drawback of star topology are
</div> </div>
</div> </div>
<div id="outline-container-org1907211" class="outline-4"> <div id="outline-container-org6bdd66c" class="outline-4">
<h4 id="org1907211"><span class="section-number-4">3.1.5.</span> Bus topology</h4> <h4 id="org6bdd66c"><span class="section-number-4">3.1.5.</span> Bus topology</h4>
<div class="outline-text-4" id="text-3-1-5"> <div class="outline-text-4" id="text-3-1-5">
<p> <p>
In bus topology, all the nodes are connected to a single backbone line. This backbone is bi-directional, there are lines from node to backbone called droplines. This topology is not robust, since if backbone is damaged, the whole network is down. In bus topology, all the nodes are connected to a single backbone line. This backbone is bi-directional, there are lines from node to backbone called droplines. This topology is not robust, since if backbone is damaged, the whole network is down.
@ -905,8 +917,8 @@ Drawbacks
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-orga8ae853" class="outline-4"> <div id="outline-container-org994566e" class="outline-4">
<h4 id="orga8ae853"><span class="section-number-4">3.1.6.</span> Ring topology</h4> <h4 id="org994566e"><span class="section-number-4">3.1.6.</span> Ring topology</h4>
<div class="outline-text-4" id="text-3-1-6"> <div class="outline-text-4" id="text-3-1-6">
<p> <p>
A daisy chain in a closed circular loop is called a ring topology. The most common method for communication in this topology is token passing. A <b>token</b> is a frame which is circulated around the network. The token is passed from one node to another till it reaches its destination. A daisy chain in a closed circular loop is called a ring topology. The most common method for communication in this topology is token passing. A <b>token</b> is a frame which is circulated around the network. The token is passed from one node to another till it reaches its destination.
@ -931,8 +943,8 @@ Disadvantages
</div> </div>
</div> </div>
<div id="outline-container-orgf3a5902" class="outline-4"> <div id="outline-container-org2951587" class="outline-4">
<h4 id="orgf3a5902"><span class="section-number-4">3.1.7.</span> Tree topology</h4> <h4 id="org2951587"><span class="section-number-4">3.1.7.</span> Tree topology</h4>
<div class="outline-text-4" id="text-3-1-7"> <div class="outline-text-4" id="text-3-1-7">
<p> <p>
Also called a star-bus topology. It can be seen as multiple star topologies connected via a backbone like in bus topology. Tree topology is hierarchical and there are parent and child star networks. It uses protocols like DHCP and SAC. The backbone is like the truck of the tree and various star networks branch out from it. Also called a star-bus topology. It can be seen as multiple star topologies connected via a backbone like in bus topology. Tree topology is hierarchical and there are parent and child star networks. It uses protocols like DHCP and SAC. The backbone is like the truck of the tree and various star networks branch out from it.
@ -962,8 +974,8 @@ Drawbacks
</div> </div>
</div> </div>
<div id="outline-container-org0e63ae0" class="outline-4"> <div id="outline-container-org3009196" class="outline-4">
<h4 id="org0e63ae0"><span class="section-number-4">3.1.8.</span> Hybrid topology</h4> <h4 id="org3009196"><span class="section-number-4">3.1.8.</span> Hybrid topology</h4>
<div class="outline-text-4" id="text-3-1-8"> <div class="outline-text-4" id="text-3-1-8">
<p> <p>
A hybrid topology is when a network combines two or more topologies in a way that does not resemble standard topologies. A hybrid topology is when a network combines two or more topologies in a way that does not resemble standard topologies.
@ -990,24 +1002,37 @@ Disadvantages
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org0dba01c" class="outline-3"> <div id="outline-container-orga8b833b" class="outline-3">
<h3 id="org0dba01c"><span class="section-number-3">3.2.</span> Digital Modulation</h3> <h3 id="orga8b833b"><span class="section-number-3">3.2.</span> Digital Modulation</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
Wires carry analog signals in form of continuously varying voltage. To send digital information, we need to devise analog signals to represent bits. This process of converting bits to analog signals is called digital modulation. Wires carry analog signals in form of continuously varying voltage. To send digital information, we need to devise analog signals to represent bits. This process of converting bits to analog signals is called digital modulation.
</p> </p>
</div> </div>
<div id="outline-container-org624aef0" class="outline-4"> <div id="outline-container-orga6decfd" class="outline-4">
<h4 id="org624aef0"><span class="section-number-4">3.2.1.</span> Bandwidth and maximum data rate</h4> <h4 id="orga6decfd"><span class="section-number-4">3.2.1.</span> Bandwidth and maximum data rate</h4>
<div class="outline-text-4" id="text-3-2-1"> <div class="outline-text-4" id="text-3-2-1">
<p> <p>
Bandwidth is the measure of carrying capacity of a medium. It is measured in Hertz (Hz). <b>Bandwidth is the measure of carrying capacity of a medium</b>. There are two ways to define bandwidth.
<br /> </p>
Note : in many places, maximum data rate is also refered to as the bandwidth. <ul class="org-ul">
<li>When working on the physical layer, <b>bandwidth can be seen as the maximum frequency of the signals</b> that can travel in the medium. It is measured in Hertz (Hz)</li>
<li>In every other context, bandwidth is the <b>maximum possible data transfer rate of the medium</b>. It is measured in bits per second (bps).</li>
</ul>
<p>
These two ways to define bandwidth are linked and are not actually different ideas.
</p>
<p>
The reason for this difference of Hz and bps measurements is that the <b>maximum frequency of medium is something that only the physical layer is concerned with.</b> In every other layer, we only care about how much data can be transferred.
</p>
<p>
Therefore, <b>unless we are working on physical layer, bandwidth is the maximum data transfer rate of the medium.</b>
</p> </p>
</div> </div>
<div id="outline-container-orgc8f1c5d" class="outline-5"> <div id="outline-container-orge836a41" class="outline-5">
<h5 id="orgc8f1c5d"><span class="section-number-5">3.2.1.1.</span> Maximum data rate for noiseless wires</h5> <h5 id="orge836a41"><span class="section-number-5">3.2.1.1.</span> Maximum data transfer rate for noiseless wires</h5>
<div class="outline-text-5" id="text-3-2-1-1"> <div class="outline-text-5" id="text-3-2-1-1">
<p> <p>
Suppose our analog signal has \(V\) different levels. Then for a noiseless wire with bandwidth of \(B\), the maximum data rate is Suppose our analog signal has \(V\) different levels. Then for a noiseless wire with bandwidth of \(B\), the maximum data rate is
@ -1018,8 +1043,8 @@ Example, a noiseless 3-kHz channel cannot transmit binary signal (two levels) at
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org37ba939" class="outline-5"> <div id="outline-container-org74f8800" class="outline-5">
<h5 id="org37ba939"><span class="section-number-5">3.2.1.2.</span> Maximum data rate for noisy wires</h5> <h5 id="org74f8800"><span class="section-number-5">3.2.1.2.</span> Maximum data transfer rate for noisy wires</h5>
<div class="outline-text-5" id="text-3-2-1-2"> <div class="outline-text-5" id="text-3-2-1-2">
<p> <p>
But the noiseless wire is an ideal case, which is not possible in real wires. Amount of noise is measured using ratio of signal power to noise power called <b>SNR (Signal-to-Noise Ratio)</b>. \(S\) denotes signal power and \(N\) denotes noise power. The ratio is expressed on a log scale as But the noiseless wire is an ideal case, which is not possible in real wires. Amount of noise is measured using ratio of signal power to noise power called <b>SNR (Signal-to-Noise Ratio)</b>. \(S\) denotes signal power and \(N\) denotes noise power. The ratio is expressed on a log scale as
@ -1038,8 +1063,8 @@ Using SNR, the maximum data rate in a noisy medium is
</div> </div>
</div> </div>
<div id="outline-container-org7cd3557" class="outline-4"> <div id="outline-container-org709c85f" class="outline-4">
<h4 id="org7cd3557"><span class="section-number-4">3.2.2.</span> Non-Return to Zero (NRZ)</h4> <h4 id="org709c85f"><span class="section-number-4">3.2.2.</span> Non-Return to Zero (NRZ)</h4>
<div class="outline-text-4" id="text-3-2-2"> <div class="outline-text-4" id="text-3-2-2">
<p> <p>
TODO : Add image TODO : Add image
@ -1056,8 +1081,8 @@ The NRZ is simple, but is seldom used by itself in practice. We use more complex
</div> </div>
</div> </div>
<div id="outline-container-org830f4d4" class="outline-4"> <div id="outline-container-orgba47841" class="outline-4">
<h4 id="org830f4d4"><span class="section-number-4">3.2.3.</span> Increasing bandwidth efficiency by symbols</h4> <h4 id="orgba47841"><span class="section-number-4">3.2.3.</span> Increasing bandwidth efficiency by symbols</h4>
<div class="outline-text-4" id="text-3-2-3"> <div class="outline-text-4" id="text-3-2-3">
<p> <p>
Bandwidth is a limited resource, therefore we must use it efficiently. Bandwidth is a limited resource, therefore we must use it efficiently.
@ -1080,8 +1105,8 @@ Note: the number of levels does not need to be a power of 2.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org8cf77b3" class="outline-4"> <div id="outline-container-org2e0dad5" class="outline-4">
<h4 id="org8cf77b3"><span class="section-number-4">3.2.4.</span> Clock recovery</h4> <h4 id="org2e0dad5"><span class="section-number-4">3.2.4.</span> Clock recovery</h4>
<div class="outline-text-4" id="text-3-2-4"> <div class="outline-text-4" id="text-3-2-4">
<p> <p>
Clocks on both sender and reciever side are used to decode the incoming signal into bits. Suppose we are sending a signal with 20 consecutive zero's. In this case it will become hard to tell bits apart, 20 zero's will look very similar to 19 or 21 zero's. Clocks on both sender and reciever side are used to decode the incoming signal into bits. Suppose we are sending a signal with 20 consecutive zero's. In this case it will become hard to tell bits apart, 20 zero's will look very similar to 19 or 21 zero's.
@ -1091,8 +1116,8 @@ Clocks on both sender and reciever side are used to decode the incoming signal i
We could use accurate clocks for this problem. But when bit rate is in multiple Mbps, the clock would need to be accurate down to less than a fraction of microsecond. Therefore, accurate clocks are not a general solution. We could use accurate clocks for this problem. But when bit rate is in multiple Mbps, the clock would need to be accurate down to less than a fraction of microsecond. Therefore, accurate clocks are not a general solution.
</p> </p>
</div> </div>
<div id="outline-container-org3c39be8" class="outline-5"> <div id="outline-container-org83e35b9" class="outline-5">
<h5 id="org3c39be8"><span class="section-number-5">3.2.4.1.</span> Manchester encoding</h5> <h5 id="org83e35b9"><span class="section-number-5">3.2.4.1.</span> Manchester encoding</h5>
<div class="outline-text-5" id="text-3-2-4-1"> <div class="outline-text-5" id="text-3-2-4-1">
<p> <p>
TODO : Add image TODO : Add image
@ -1108,8 +1133,8 @@ Therefore, the downside of manchester encoding is that it requires <b>twice as m
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org85693d2" class="outline-5"> <div id="outline-container-orgfc45c3c" class="outline-5">
<h5 id="org85693d2"><span class="section-number-5">3.2.4.2.</span> Non-Return-to-Zero Inverted (NRZI)</h5> <h5 id="orgfc45c3c"><span class="section-number-5">3.2.4.2.</span> Non-Return-to-Zero Inverted (NRZI)</h5>
<div class="outline-text-5" id="text-3-2-4-2"> <div class="outline-text-5" id="text-3-2-4-2">
<p> <p>
TODO : Add image TODO : Add image
@ -1128,8 +1153,8 @@ In NRZI, rather than using levels to represent bits, <b>we use transitions to re
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org27a7f54" class="outline-5"> <div id="outline-container-org0dcf6ae" class="outline-5">
<h5 id="org27a7f54"><span class="section-number-5">3.2.4.3.</span> 4B/5B</h5> <h5 id="org0dcf6ae"><span class="section-number-5">3.2.4.3.</span> 4B/5B</h5>
<div class="outline-text-5" id="text-3-2-4-3"> <div class="outline-text-5" id="text-3-2-4-3">
<p> <p>
To truly fix the issue, we can break long runs of 0's by mapping group of bits to longer patterns that do not have consecutive 0's. To truly fix the issue, we can break long runs of 0's by mapping group of bits to longer patterns that do not have consecutive 0's.
@ -1247,8 +1272,8 @@ Since there are 32 different 5 bit patterns and all of them are not used. We can
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-org51fae35" class="outline-5"> <div id="outline-container-orge986a37" class="outline-5">
<h5 id="org51fae35"><span class="section-number-5">3.2.4.4.</span> Scrambling</h5> <h5 id="orge986a37"><span class="section-number-5">3.2.4.4.</span> Scrambling</h5>
<div class="outline-text-5" id="text-3-2-4-4"> <div class="outline-text-5" id="text-3-2-4-4">
<p> <p>
Another approach is scrambling the bits to reduce chances of long runs of 0's. Another approach is scrambling the bits to reduce chances of long runs of 0's.
@ -1268,8 +1293,8 @@ However, since scrambling is pseudorandom there is <b>no guarentee that long run
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgf219134" class="outline-4"> <div id="outline-container-orgcb6a702" class="outline-4">
<h4 id="orgf219134"><span class="section-number-4">3.2.5.</span> Balanced signals</h4> <h4 id="orgcb6a702"><span class="section-number-4">3.2.5.</span> Balanced signals</h4>
<div class="outline-text-4" id="text-3-2-5"> <div class="outline-text-4" id="text-3-2-5">
<p> <p>
Signals that have almost as many positive voltages as negative voltages are called <b>balanced signals.</b> Balanced signals <b>average to zero</b>, which means they have no DC electrical component. Signals that have almost as many positive voltages as negative voltages are called <b>balanced signals.</b> Balanced signals <b>average to zero</b>, which means they have no DC electrical component.
@ -1285,7 +1310,299 @@ We need balanced signals because
<li>Balanced signals have <b>easier clock recovery</b> since there is a mix of positive and negative voltages.</li> <li>Balanced signals have <b>easier clock recovery</b> since there is a mix of positive and negative voltages.</li>
<li>It helps in <b>calibration of receivers</b> as they can check average of signals to decode symbols. In <b>unbalanced signals, the average drifts causing errors.</b></li> <li>It helps in <b>calibration of receivers</b> as they can check average of signals to decode symbols. In <b>unbalanced signals, the average drifts causing errors.</b></li>
</ul> </ul>
</div>
<div id="outline-container-orgb52d16a" class="outline-5">
<h5 id="orgb52d16a"><span class="section-number-5">3.2.5.1.</span> Alternate Mark Inversion (AMI)</h5>
<div class="outline-text-5" id="text-3-2-5-1">
<p>
TODO : Add image
</p>
<p>
AMI encoding adds another voltage level to achieve the balance. It is a bipolar encoding, i.e it uses <b>positive and negative voltages to represent 1 bit and no voltage to represent 0 bit</b>.
</p>
<p>
Therefore, <b>there are 3 levels in the signal +, - and 0.</b> The 1 bit will cycle between positive and negative values, to make signal balanced. The <b>pair of voltages chosen cancel each other</b> (example, + is +5V and - is -5V).
</p>
<p>
<b>0 bits are all represented by 0V</b>
</p>
<p>
The <b>first 1</b> bit in sequence is <b>+</b>
<br />
The <b>second 1</b> bit in sequence is <b>-</b>
<br />
The <b>third 1</b> bit in sequence is <b>+</b>
<br />
<b>and so on.</b>
</p>
<p>
Suppose + is +5V and - is -5V. The encoding will be as follows
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="all" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
<col class="org-right" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Bits</th>
<th scope="col" class="org-right">1</th>
<th scope="col" class="org-right">0</th>
<th scope="col" class="org-right">1</th>
<th scope="col" class="org-right">0</th>
<th scope="col" class="org-right">0</th>
<th scope="col" class="org-right">1</th>
<th scope="col" class="org-right">1</th>
<th scope="col" class="org-right">1</th>
<th scope="col" class="org-right">0</th>
<th scope="col" class="org-right">0</th>
<th scope="col" class="org-right">1</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Signal</td>
<td class="org-right">+</td>
<td class="org-right">0</td>
<td class="org-right">-</td>
<td class="org-right">0</td>
<td class="org-right">0</td>
<td class="org-right">+</td>
<td class="org-right">-</td>
<td class="org-right">+</td>
<td class="org-right">0</td>
<td class="org-right">0</td>
<td class="org-right">-</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left">Voltage (V)</td>
<td class="org-right">+5</td>
<td class="org-right">0</td>
<td class="org-right">-5</td>
<td class="org-right">0</td>
<td class="org-right">0</td>
<td class="org-right">+5</td>
<td class="org-right">-5</td>
<td class="org-right">+5</td>
<td class="org-right">0</td>
<td class="org-right">0</td>
<td class="org-right">-5</td>
</tr>
</tbody>
</table>
<p>
In old terminology, 1 is called a "mark" and 0 is called a "space".
</p>
</div>
</div>
<div id="outline-container-org3509b66" class="outline-5">
<h5 id="org3509b66"><span class="section-number-5">3.2.5.2.</span> 8B/10B</h5>
<div class="outline-text-5" id="text-3-2-5-2">
<p>
If we don't want to add another level to achieve balance, we can use mapping similar to 4B/5B.
<b>A balanced code is 8B/10B.</b> It will map 8 bits to 10 bits, therefore it is <b>80%</b> efficient.
</p>
<p>
The 8B/10B coding will first take the <b>first 5 bits from 8 bit input and map it to 6 bits</b> (using a 5B/6B). Then it will take the <b>remaining 3 bits and map them to 4 bits</b> (using a 3B/4B). Finally the 6 bits and 4 bits are concatenated to get 10 bits.
</p>
<p>
The 3B/4B and 5B/6B will try to produce codes that are balanced. For example, "001" will be mapped to "1001" by 3B/4B. But producing all codes balanced is not possible in this way.
</p>
<p>
<b>Both 3B/4B and 5B/6B can map an input into one of two outputs</b>, one with an extra 1 and other with extra 0. This pair of outputs are usually complement of each other. As these two codes map bits, the <b>encoder will remember the disparity</b> between the two produced codes. Then it will choose one of the two possible outputs such that disparity is reduced.
</p>
<ul class="org-ul">
<li>8B/10B guarentees that <b>disparity is at most 2</b>. So signal will never be far from balanced.</li>
<li>8B/10B will <b>never have more than 5 cosecutive 1's or 0's</b>, therefore it can be used for <b>clock recovery</b>.</li>
</ul>
<p>
<hr />
</p>
</div>
</div>
</div>
</div>
<div id="outline-container-orgba83308" class="outline-3">
<h3 id="orgba83308"><span class="section-number-3">3.3.</span> Switching</h3>
<div class="outline-text-3" id="text-3-3">
<p>
Two different switching techniques are used by networks.
</p>
<ul class="org-ul">
<li><b>Circuit switching</b> : the switching used in traditional telephone systems</li>
<li><b>Packet switching</b> : the switching used in IP technology</li>
</ul>
<p>
This section will only provide brief introduction with relation to physical layer. Switching is later discussed in network layer.
</p>
</div>
<div id="outline-container-org08c9017" class="outline-4">
<h4 id="org08c9017"><span class="section-number-4">3.3.1.</span> Circuit switching</h4>
<div class="outline-text-4" id="text-3-3-1">
<p>
When a telephone call is placed, the switching equipment looks for a <b>single path</b> from sender to receiver and maintains it for the duration of the communication. This technique of having a direct physical connection is called <b>circuit switching</b>.
</p>
<p>
In early days of telephone, connection was made by operator by plugging jumper cables into input and output sockets. Automatic circuit switching was invented by Almon B. Strowger. For nearly a 100 years, the automatic circuit switching equipment used worldwide was known as Strowger gear.
</p>
<p>
The parts of path between telephone may in fact be microwave or fibre or any other type of medium. There are thousand of calls multiplexed on parts of links.
</p>
<p>
The main property of circuit switching is that <b>there is a single path for the whole duration of communication.</b> Therefore, it needs to set up and end-to-end path before any data can be sent. The bandwidth required for communication is also reserved before data is sent.
</p>
<p>
Since there is a reserved path, <b>once setup is complete the only dealy for data is propogation time for signals</b>. Also once path is reserved, there is no danger of congestion. Of course the <b>conjestion can be felt before connection is established, as it may take a while due to switching or trunk capacity.</b>
</p>
</div>
</div>
<div id="outline-container-org8ace8aa" class="outline-4">
<h4 id="org8ace8aa"><span class="section-number-4">3.3.2.</span> Packet switching</h4>
<div class="outline-text-4" id="text-3-3-2">
<p>
In contrast to circuit switching, there is <b>no need to set up dedicated path in advance. Packet switching is analogous to sending data in form of series of letters using postal system</b>.
</p>
<p>
Each packet will travel independently of others and can choose any path to reach destination in the network. It is <b>up to routers</b> to use store-and-forward transmission to send each packet on its way towards the destination. Since every packet travels independently, they may arrive out of order.
</p>
<p>
Packet-switching networks place <b>tight upper limit on the packet sizes</b>. This ensures that <b>no single user can monopolize any transmission line for long</b>, so that network can handle interactive traffic. It also reduces delay since first packet of a long message can be forwarded before second is fully formed. However, there is more delay than circuit switching. In ciruit switching, bits can flow continuously without anything ever being stored and forwarded later.
</p>
<p>
Since bandwidth is not reserved, packets may have to wait to be forwarded, this introduces <b>queuing delay</b> and congestion. On the other hand, we don't have to wait to establish a connection. Therefore, in circuit switching (during setup) and packet switching (packets are travelling) congestion occurs at different times.
</p>
<p>
Packet switching does not waster bandwidth which is limited resource. <b>Packet switching is also more fault tolerant</b>, in fact that was why packet switching was chosen for internet. If some switches go down, packets can travel around them.
</p>
<p>
These differences in the types of switching also leads to the difference in which billing is usually done for both networks. With circuit switching main load factors are distance and time of communication, therefore billing is done for how long connection is established (talktime on phone calles). Whereas in packet switching main load factor is how much traffic is added to network by a user, therefore billing is done based on how much data is transferred by user.
</p>
<p>
The <b>difference between circuit and packet switching</b> is
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Item</th>
<th scope="col" class="org-left">Circuit switched</th>
<th scope="col" class="org-left">Packet switched</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">Call Setup</td>
<td class="org-left">Required</td>
<td class="org-left">Not needed</td>
</tr>
<tr>
<td class="org-left">Dedicated Physical Path</td>
<td class="org-left">Yes</td>
<td class="org-left">No</td>
</tr>
<tr>
<td class="org-left">Whole data follows same path</td>
<td class="org-left">Yes</td>
<td class="org-left">No</td>
</tr>
<tr>
<td class="org-left">Data arrives in order</td>
<td class="org-left">Yes</td>
<td class="org-left">No</td>
</tr>
<tr>
<td class="org-left">Is a switch crash fatal</td>
<td class="org-left">Yes</td>
<td class="org-left">No</td>
</tr>
<tr>
<td class="org-left">Bandwidth available</td>
<td class="org-left">Fixed</td>
<td class="org-left">Dynamic</td>
</tr>
<tr>
<td class="org-left">Time of possible congestion</td>
<td class="org-left">At setup</td>
<td class="org-left">On every packet</td>
</tr>
<tr>
<td class="org-left">Potentially wasted bandwidth</td>
<td class="org-left">Yes</td>
<td class="org-left">No</td>
</tr>
<tr>
<td class="org-left">Store-and-forward transmission</td>
<td class="org-left">No</td>
<td class="org-left">Yes</td>
</tr>
<tr>
<td class="org-left">Billing</td>
<td class="org-left">Per minute</td>
<td class="org-left">Per Byte</td>
</tr>
</tbody>
</table>
<p> <p>
<hr /> <hr />
</p> </p>
@ -1293,10 +1610,18 @@ We need balanced signals because
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org571cce0" class="outline-2">
<h2 id="org571cce0"><span class="section-number-2">4.</span> Data Link Layer</h2>
<div class="outline-text-2" id="text-4">
<p>
<hr />
</p>
</div>
</div>
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Anmol Nawani</p> <p class="author">Author: Anmol Nawani</p>
<p class="date">Created: 2023-08-13 Sun 18:07</p> <p class="date">Created: 2023-08-16 Wed 21:42</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

@ -304,16 +304,19 @@ Disadvantages
** Digital Modulation ** Digital Modulation
Wires carry analog signals in form of continuously varying voltage. To send digital information, we need to devise analog signals to represent bits. This process of converting bits to analog signals is called digital modulation. Wires carry analog signals in form of continuously varying voltage. To send digital information, we need to devise analog signals to represent bits. This process of converting bits to analog signals is called digital modulation.
*** Bandwidth and maximum data rate *** Bandwidth and maximum data rate
Bandwidth is the measure of carrying capacity of a medium. It is measured in Hertz (Hz). *Bandwidth is the measure of carrying capacity of a medium*. There are two ways to define bandwidth.
\\ + When working on the physical layer, *bandwidth can be seen as the maximum frequency of the signals* that can travel in the medium. It is measured in Hertz (Hz)
Note : in many places, maximum data rate is also refered to as the bandwidth. + In every other context, bandwidth is the *maximum possible data transfer rate of the medium*. It is measured in bits per second (bps).
**** Maximum data rate for noiseless wires These two ways to define bandwidth are linked and are not actually different ideas.
The reason for this difference of Hz and bps measurements is that the *maximum frequency of medium is something that only the physical layer is concerned with.* In every other layer, we only care about how much data can be transferred. Therefore, *unless we are working on physical layer, bandwidth is the maximum data transfer rate of the medium.*
**** Maximum data transfer rate for noiseless wires
Suppose our analog signal has $V$ different levels. Then for a noiseless wire with bandwidth of $B$, the maximum data rate is Suppose our analog signal has $V$ different levels. Then for a noiseless wire with bandwidth of $B$, the maximum data rate is
\[ \text{maximum data rate} = 2\ B\ log_2V \text{ bits/sec} \] \[ \text{maximum data rate} = 2\ B\ log_2V \text{ bits/sec} \]
When converting bits, if we are only using two levels, one for 0 bit and one for 1 bit. So, we can in most cases simplify the formula to When converting bits, if we are only using two levels, one for 0 bit and one for 1 bit. So, we can in most cases simplify the formula to
\[ \text{maximum data rate} = 2\ B \text{ bits/sec} \] \[ \text{maximum data rate} = 2\ B \text{ bits/sec} \]
Example, a noiseless 3-kHz channel cannot transmit binary signal (two levels) at rate exceeding 6000 bps. Example, a noiseless 3-kHz channel cannot transmit binary signal (two levels) at rate exceeding 6000 bps.
**** Maximum data rate for noisy wires **** Maximum data transfer rate for noisy wires
But the noiseless wire is an ideal case, which is not possible in real wires. Amount of noise is measured using ratio of signal power to noise power called *SNR (Signal-to-Noise Ratio)*. $S$ denotes signal power and $N$ denotes noise power. The ratio is expressed on a log scale as But the noiseless wire is an ideal case, which is not possible in real wires. Amount of noise is measured using ratio of signal power to noise power called *SNR (Signal-to-Noise Ratio)*. $S$ denotes signal power and $N$ denotes noise power. The ratio is expressed on a log scale as
\[ SNR = 10\ log_{10} (S/N) \text{ dB} \] \[ SNR = 10\ log_{10} (S/N) \text{ dB} \]
The unit of SNR is *decibals (dB)* The unit of SNR is *decibals (dB)*
@ -407,5 +410,87 @@ We need balanced signals because
+ If signal is not balanced, we waste energy because DC component is filtered out. + If signal is not balanced, we waste energy because DC component is filtered out.
+ Balanced signals have *easier clock recovery* since there is a mix of positive and negative voltages. + Balanced signals have *easier clock recovery* since there is a mix of positive and negative voltages.
+ It helps in *calibration of receivers* as they can check average of signals to decode symbols. In *unbalanced signals, the average drifts causing errors.* + It helps in *calibration of receivers* as they can check average of signals to decode symbols. In *unbalanced signals, the average drifts causing errors.*
**** Alternate Mark Inversion (AMI)
TODO : Add image
AMI encoding adds another voltage level to achieve the balance. It is a bipolar encoding, i.e it uses *positive and negative voltages to represent 1 bit and no voltage to represent 0 bit*.
Therefore, *there are 3 levels in the signal +, - and 0.* The 1 bit will cycle between positive and negative values, to make signal balanced. The *pair of voltages chosen cancel each other* (example, + is +5V and - is -5V).
*0 bits are all represented by 0V*
The *first 1* bit in sequence is *+*
\\
The *second 1* bit in sequence is *-*
\\
The *third 1* bit in sequence is *+*
\\
*and so on.*
Suppose + is +5V and - is -5V. The encoding will be as follows
#+ATTR_HTML: :rules all
| Bits | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 |
|-------------+----+---+----+---+---+----+----+----+---+---+----|
| Signal | + | 0 | - | 0 | 0 | + | - | + | 0 | 0 | - |
|-------------+----+---+----+---+---+----+----+----+---+---+----|
| Voltage (V) | +5 | 0 | -5 | 0 | 0 | +5 | -5 | +5 | 0 | 0 | -5 |
In old terminology, 1 is called a "mark" and 0 is called a "space".
**** 8B/10B
If we don't want to add another level to achieve balance, we can use mapping similar to 4B/5B.
*A balanced code is 8B/10B.* It will map 8 bits to 10 bits, therefore it is *80%* efficient.
The 8B/10B coding will first take the *first 5 bits from 8 bit input and map it to 6 bits* (using a 5B/6B). Then it will take the *remaining 3 bits and map them to 4 bits* (using a 3B/4B). Finally the 6 bits and 4 bits are concatenated to get 10 bits.
The 3B/4B and 5B/6B will try to produce codes that are balanced. For example, "001" will be mapped to "1001" by 3B/4B. But producing all codes balanced is not possible in this way.
*Both 3B/4B and 5B/6B can map an input into one of two outputs*, one with an extra 1 and other with extra 0. This pair of outputs are usually complement of each other. As these two codes map bits, the *encoder will remember the disparity* between the two produced codes. Then it will choose one of the two possible outputs such that disparity is reduced.
+ 8B/10B guarentees that *disparity is at most 2*. So signal will never be far from balanced.
+ 8B/10B will *never have more than 5 cosecutive 1's or 0's*, therefore it can be used for *clock recovery*.
@@html:<hr />@@
** Switching
Two different switching techniques are used by networks.
+ *Circuit switching* : the switching used in traditional telephone systems
+ *Packet switching* : the switching used in IP technology
This section will only provide brief introduction with relation to physical layer. Switching is later discussed in network layer.
*** Circuit switching
When a telephone call is placed, the switching equipment looks for a *single path* from sender to receiver and maintains it for the duration of the communication. This technique of having a direct physical connection is called *circuit switching*.
In early days of telephone, connection was made by operator by plugging jumper cables into input and output sockets. Automatic circuit switching was invented by Almon B. Strowger. For nearly a 100 years, the automatic circuit switching equipment used worldwide was known as Strowger gear.
The parts of path between telephone may in fact be microwave or fibre or any other type of medium. There are thousand of calls multiplexed on parts of links.
The main property of circuit switching is that *there is a single path for the whole duration of communication.* Therefore, it needs to set up and end-to-end path before any data can be sent. The bandwidth required for communication is also reserved before data is sent.
Since there is a reserved path, *once setup is complete the only dealy for data is propogation time for signals*. Also once path is reserved, there is no danger of congestion. Of course the *conjestion can be felt before connection is established, as it may take a while due to switching or trunk capacity.*
*** Packet switching
In contrast to circuit switching, there is *no need to set up dedicated path in advance. Packet switching is analogous to sending data in form of series of letters using postal system*.
Each packet will travel independently of others and can choose any path to reach destination in the network. It is *up to routers* to use store-and-forward transmission to send each packet on its way towards the destination. Since every packet travels independently, they may arrive out of order.
Packet-switching networks place *tight upper limit on the packet sizes*. This ensures that *no single user can monopolize any transmission line for long*, so that network can handle interactive traffic. It also reduces delay since first packet of a long message can be forwarded before second is fully formed. However, there is more delay than circuit switching. In ciruit switching, bits can flow continuously without anything ever being stored and forwarded later.
Since bandwidth is not reserved, packets may have to wait to be forwarded, this introduces *queuing delay* and congestion. On the other hand, we don't have to wait to establish a connection. Therefore, in circuit switching (during setup) and packet switching (packets are travelling) congestion occurs at different times.
Packet switching does not waster bandwidth which is limited resource. *Packet switching is also more fault tolerant*, in fact that was why packet switching was chosen for internet. If some switches go down, packets can travel around them.
These differences in the types of switching also leads to the difference in which billing is usually done for both networks. With circuit switching main load factors are distance and time of communication, therefore billing is done for how long connection is established (talktime on phone calles). Whereas in packet switching main load factor is how much traffic is added to network by a user, therefore billing is done based on how much data is transferred by user.
The *difference between circuit and packet switching* is
|--------------------------------+------------------+-----------------|
| Item | Circuit switched | Packet switched |
|--------------------------------+------------------+-----------------|
| Call Setup | Required | Not needed |
| Dedicated Physical Path | Yes | No |
| Whole data follows same path | Yes | No |
| Data arrives in order | Yes | No |
| Is a switch crash fatal | Yes | No |
| Bandwidth available | Fixed | Dynamic |
| Time of possible congestion | At setup | On every packet |
| Potentially wasted bandwidth | Yes | No |
| Store-and-forward transmission | No | Yes |
| Billing | Per minute | Per Byte |
|--------------------------------+------------------+-----------------|
@@html:<hr />@@
#+INCLUDE: "./datalink.org" :minlevel 1
@@html:<hr />@@ @@html:<hr />@@

Loading…
Cancel
Save