Computer Networking
Cover
1ZT-ICT-H6.pptx
Summary
# Kernconcepten van datacommunicatie
Dit gedeelte behandelt de fundamentele principes van datacommunicatie, van de aard van signalen tot methoden om efficiënt gebruik te maken van transmissielijnen.
### 1.1 Analoge versus digitale signalen
Data kan worden gerepresenteerd door zowel analoge als digitale signalen. Analoge signalen zijn continu en variëren vloeiend, terwijl digitale signalen discreet zijn en specifieke waarden aannemen. Hoewel binaire data initieel met voltages kan worden verzonden, is dit over grote afstanden niet praktisch. Andere methoden, zoals modulatietechnieken, zijn nodig om deze data effectiever te transporteren.
### 1.2 Modulatietechnieken
Modulatie is het proces waarbij informatie, zoals binaire data, wordt geplaatst op een draaggolf, typisch een elektromagnetische golf. De belangrijkste eigenschappen van een sinusvormige draaggolf die gemanipuleerd kunnen worden, zijn:
* **Amplitude:** De maximale sterkte van de golf.
* **Frequentie:** Het aantal trillingen per tijdseenheid.
* **Fase:** De relatieve positie van de golf in zijn cyclus.
Door deze eigenschappen aan te passen op basis van de te verzenden data, kunnen digitale signalen op een analoog medium worden overgebracht. Moderne modulatietechnieken maken vaak gebruik van combinaties van deze parameters voor een efficiëntere en robuustere datacommunicatie.
### 1.3 Lijnen besparen: multiplexing
Om de capaciteit van transmissielijnen efficiënt te benutten, worden multiplexingstechnieken toegepast. Dit stelt meerdere datastromen in staat om dezelfde fysieke transmissielijn te delen. De belangrijkste methoden zijn:
* **Time Division Multiplexing (TDM):** Verschillende datastromen krijgen elk een specifiek tijdssegment toegewezen om de lijn te gebruiken.
* **Statistical Time Division Multiplexing (STDM):** Een meer dynamische vorm van TDM waarbij tijdsloten alleen worden toegewezen aan datastromen die daadwerkelijk data te verzenden hebben, wat leidt tot een efficiëntere benutting van de bandbreedte.
* **Frequency Division Multiplexing (FDM):** Verschillende datastromen worden toegewezen aan verschillende frequentiebanden op dezelfde transmissielijn. Dit is bijvoorbeeld de basis voor analoge televisie- en radio-uitzendingen.
### 1.4 Simplex, half-duplex & full-duplex communicatie
Dit beschrijft de richtingsmogelijkheden van datacommunicatie:
* **Simplex:** Communicatie verloopt slechts in één richting (bv. een radiozender naar een ontvanger).
* **Half-duplex:** Communicatie kan in beide richtingen plaatsvinden, maar slechts één richting tegelijk (bv. een portofoon).
* **Full-duplex:** Communicatie kan simultaan in beide richtingen plaatsvinden (bv. een telefoongesprek).
### 1.5 Unicast, multicast & broadcast
Dit categoriseert de bestemmingswijze van data:
* **Unicast:** Data wordt verzonden van een bron naar één specifieke bestemming.
* **Multicast:** Data wordt verzonden van een bron naar een groep van specifieke bestemmingen.
* **Broadcast:** Data wordt verzonden van een bron naar alle mogelijke bestemmingen binnen een netwerk.
### 1.6 Bandbreedte en doorvoersnelheid
* **Bandbreedte (Bandwidth) of Kanaalcapaciteit:** Dit is de theoretische maximale capaciteit van een transmissiemedium om data te verzenden, uitgedrukt in bits per seconde (bps). Gangbare eenheden zijn kilobits per seconde ($1$ kb/s of $1$ kbps), megabits per seconde ($1$ Mb/s of $1$ Mbps) en gigabits per seconde ($1$ Gb/s of $1$ Gbps). Het is belangrijk om onderscheid te maken tussen bits en bytes.
* **Doorvoersnelheid (Throughput):** Dit is de werkelijke, praktische capaciteit van een netwerkverbinding van eindpunt tot eindpunt, eveneens uitgedrukt in bits per seconde. De doorvoersnelheid houdt rekening met factoren zoals vertragingen veroorzaakt door netwerkapparatuur, gedeelde lijncapaciteit door multiplexing, en ander netwerkverkeer.
> **Tip:** Bandbreedte is een theoretische limiet, terwijl doorvoersnelheid de gemeten prestatie is. De doorvoersnelheid zal altijd lager of gelijk zijn aan de bandbreedte.
### 1.7 Bottleneck
Een bottleneck is het zwakke punt in een netwerkverbinding dat de algehele prestatie beperkt. Dit kan een specifieke apparaat, een kabel met lage capaciteit, of een druk netwerksegment zijn.
### 1.8 Transmissiemedia
Transmissiemedia zijn de fysieke paden waarlangs data wordt verzonden. Ze kunnen grofweg worden onderverdeeld in draadloze en bekabelde media.
#### 1.8.1 Draadloze transmissiemedia
Draadloze communicatie maakt gebruik van elektromagnetische golven die door de lucht of ruimte reizen. Historisch gezien heeft de ontwikkeling van draadloze datacommunicatie significante stappen gezet, beginnend met vroege experimenten en culminerend in moderne mobiele netwerken.
* **Frequentiespectrum:** Draadloze communicatie opereert binnen specifieke frequentiebanden van het elektromagnetisch spectrum. De frequentie $(f)$ wordt gemeten in Hertz (Hz) en bepaalt de snelheid van de golftrillingen. De periode $(T)$ is de tijd voor één trilling, en is gerelateerd aan de frequentie door $T = 1/f$. De golflengte $(\lambda)$ is de fysieke lengte van één periode van de golf en wordt berekend als de snelheid van de golf $(v)$ gedeeld door de frequentie: $\lambda = v/f$. Verschillende toepassingen, zoals FM-radio en GSM-netwerken, maken gebruik van specifieke delen van dit spectrum.
* **Antennes:** Antennes zijn essentieel voor het verzenden en ontvangen van draadloze signalen. Hun ontwerp, zoals Yagi-, schotel- of rechte antennes, is afhankelijk van de frequentie en de gewenste signaalrichting. Chipantennes worden gebruikt in kleine apparaten.
#### 1.8.2 Bekabelde transmissiemedia
Bekabelde media maken gebruik van fysieke kabels om data te transporteren.
* **Koper:** Dit omvat verschillende kabeltypen zoals:
* **UTP (Unshielded Twisted Pair):** Veelgebruikt in Ethernet-netwerken, waarbij paren van koperdraden zijn getwist om interferentie tegen te gaan. De maximale afstand is typisch 100 meter.
* **Coaxkabel:** Beschikt over een centrale geleider omgeven door een isolator en een metalen afscherming (kooi van Faraday) die helpt bij het verminderen van elektromagnetische interferentie (EMI) en radiofrequentie-interferentie (RFI). Wordt onder andere gebruikt voor analoge televisie (FDM) en internetverbindingen.
* **Telefoonkabel:** Traditionele koperen kabels die worden gebruikt voor telefonie en ook voor DSL-internetverbindingen (zoals ADSL, VDSL).
**Problemen met koperkabels** zijn onder andere signaalverzwakking over lange afstanden, interferentie van externe bronnen, en veiligheidsrisico's.
* **Glasvezel (Fiber):** Deze kabels transporteren data als lichtpulsen door dunne glas- of kunststofdraden.
* **Voordelen:** Sterke beveiliging (moeilijk te "hijacken"), kunnen grote afstanden overbruggen met minimale signaalverlies, bieden extreem hoge snelheden, en zijn immuun voor EMI/RFI.
* **Nadelen:** Hogere kosten en minder flexibiliteit in vergelijking met koper.
* **Types:** Glasvezel kan worden onderverdeeld in Single-Mode (SM) voor lange afstanden met hoge snelheden en Multi-Mode (MM) voor kortere afstanden.
### 1.9 Netwerktopologie
Een netwerktopologie beschrijft de fysieke of logische indeling van apparaten en verbindingen in een netwerk. Minimale communicatie vereist minstens twee apparaten met een transmissiemedium ertussen. Veelvoorkomende topologieën zijn:
* **Maas (Mesh):** Elk apparaat is verbonden met elk ander apparaat (volledig) of met meerdere andere apparaten (gedeeltelijk).
* **Bus:** Alle apparaten zijn verbonden met een centrale, gedeelde kabel.
* **Ster (Star):** Alle apparaten zijn verbonden met een centraal knooppunt (bv. een switch of hub).
* **Ring:** Apparaten zijn verbonden in een gesloten lus.
* **Ketting (Chain/Daisy Chain):** Apparaten zijn sequentieel met elkaar verbonden.
* **Boom (Tree):** Een hiërarchische structuur die lijkt op een stertopologie, maar met meerdere niveaus.
* **Hybride:** Een combinatie van twee of meer verschillende topologieën.
Het is belangrijk om onderscheid te maken tussen de **logische** (hoe data stroomt) en de **fysieke** (hoe de kabels zijn gelegd) netwerktopologie.
### 1.10 Het internet
Het internet is het grootste wereldwijde netwerk van computers, dat informatie uitwisselt via gestandaardiseerde protocollen. Internet Service Providers (ISP's) verbinden huishoudens en bedrijven met dit netwerk. Verschillende technologieën worden gebruikt voor internettoegang, waaronder:
* **DSL (Digital Subscriber Line):** Maakt gebruik van bestaande telefoonkabelinfrastructuur. Varianten zoals HDSL, ADSL, VDSL, ADSL2, ADSL2+, en VDSL2 bieden verschillende snelheden en bereiken.
* **Coaxkabel (HFC - Hybrid Fiber Coaxial network):** Gebruikt door kabelproviders, vaak in combinatie met glasvezel, en maakt gebruik van standaarden zoals DOCSIS (Data Over Cable Service Interface Specification).
* **Glasvezel (FTTH - Fiber To The Home):** Biedt de hoogste snelheden en betrouwbaarheid.
* **Satelliet en Terrestriële uitzendingen:** Worden gebruikt in gebieden waar andere verbindingen niet beschikbaar zijn.
### 1.11 Schakelmethoden
Dit beschrijft hoe data wordt gerouteerd in een netwerk:
* **Circuit Switching:** Een dedicated, fysieke verbinding wordt opgebouwd tussen de zender en ontvanger voor de duur van de communicatie. Dit garandeert bandbreedte maar is inefficiënt bij intermitterend verkeer.
* **Message Switching:** Hele berichten worden van knooppunt naar knooppunt verzonden en opgeslagen totdat de volgende hop beschikbaar is. De weg is niet vooraf bepaald.
* **Packet Switching:** Berichten worden opgedeeld in kleinere eenheden genaamd pakketten. Elk pakket bevat adresinformatie en wordt onafhankelijk gerouteerd, waardoor een efficiëntere benutting van netwerkbronnen mogelijk is. Dit is de basis van het internet.
### 1.12 Protocollen en gelaagde modellen
Protocollen zijn een set regels die de communicatie tussen apparaten definiëren, inclusief formaat, timing, codering, inkapseling en de volgorde van informatie-uitwisseling. Netwerkstandaarden zijn gestandaardiseerde protocollen die interoperabiliteit waarborgen.
Gelaagde modellen, zoals het **OSI Model** (International Organization for Standardization) en het **TCP/IP Model**, organiseren netwerkfunctionaliteit in verschillende lagen. Elke laag heeft specifieke taken en communiceert met de lagen erboven en eronder.
* **OSI Model (7 lagen):**
1. **Applicatielaag (Application Layer):** Eindgebruikersinterfaces en applicatieprocessen.
2. **Presentatielaag (Presentation Layer):** Gegevensconversie, codering en compressie.
3. **Sessielaag (Session Layer):** Opzetten, beheren en verbreken van communicatiesessies.
4. **Transportlaag (Transport Layer):** End-to-end datatransport, segmentatie en foutcorrectie.
5. **Netwerklaag (Network Layer):** Logische adressering en routering van pakketten.
6. **Datalinklaag (Data Link Layer):** Fysieke adressering, frame-synchronisatie en foutdetectie op een link.
7. **Fysieke laag (Physical Layer):** Mechanische en elektrische specificaties voor de fysieke verbinding.
* **TCP/IP Model (4 lagen):** Een meer praktisch model dat de functies van het OSI-model combineert.
* **Netwerktoegangslaag (Network Access Layer):** Combineert de fysieke en datalinklagen.
* **Internetlaag (Internet Layer):** Komt overeen met de netwerklaag.
* **Transportlaag (Transport Layer):** Behoudt zijn functie.
* **Applicatielaag (Application Layer):** Combineert de sessie-, presentatie- en applicatielagen.
**Inkapseling** is een cruciaal proces waarbij per laag informatie (headers) wordt toegevoegd aan de data, zodat de ontvanger deze correct kan verwerken en aan de juiste applicatie kan afleveren. Bijvoorbeeld, op de transportlaag wordt data een "segment", op de internetlaag een "packet", en op de netwerktoegangslaag een "frame".
---
# Transmissiemedia en netwerktopologieën
Dit onderwerp behandelt de verschillende fysieke manieren waarop data kan worden verzonden, zowel via kabels als draadloos, en hoe apparaten in een netwerk met elkaar verbonden zijn.
### 2.1 Transmissiemedia
Transmissiemedia vormen de fysieke weg waarlangs digitale informatie wordt verzonden. Deze media kunnen worden onderverdeeld in draadloze en bekabelde opties.
#### 2.1.1 Draadloze transmissiemedia
Draadloze communicatie maakt gebruik van elektromagnetische golven om data te verzenden. Dit omvat historische toepassingen zoals radio en moderne technologieën zoals mobiele netwerken.
* **Frequentie, Periode en Golflengte:**
* **Frequentie** is het aantal trillingen per tijdseenheid, uitgedrukt in Hertz (Hz) of $1/s$.
* **Periode** is de tijd die één volledige trilling in beslag neemt, uitgedrukt in seconden ($s$). De relatie is $T = 1/f$.
* **Golflengte** ($\lambda$) is de lengte van één volledige periode van een elektromagnetische golf, uitgedrukt in meters ($m$). Het wordt berekend als de snelheid van de golf ($v$) gedeeld door de frequentie ($f$): $\lambda = v/f$.
* **Antennes:** Antennes zijn essentieel voor draadloze communicatie. Hun ontwerp en grootte zijn vaak afhankelijk van de frequentie en golflengte van de te verzenden of ontvangen signalen. Voorbeelden zijn Yagi-antennes, schotelantennes (die signalen reflecteren naar een centrale ontvanger), rechte antennes en kleine chipantennes.
* **Voorbeelden van draadloze technologieën:**
* FM Radio
* GSM-netwerk
#### 2.1.2 Bekabelde transmissiemedia
Bekabelde media maken gebruik van fysieke kabels om data te transporteren.
* **Koperkabels:** Dit is een veelvoorkomend type bekabeld medium, met verschillende varianten:
* **UTP (Unshielded Twisted Pair):** Bekend van Ethernet-netwerken. De aders zijn gedraaid om interferentie tegen te gaan. Een typische limiet is 100 meter.
* **Coaxkabel:** Gebruikt voor bijvoorbeeld analoge televisie-uitzendingen en internetverbindingen via kabelaars. De kooi van Faraday in de kabel helpt bij het verminderen van elektromagnetische interferentie (EMI) en radiofrequentie-interferentie (RFI). Het wordt ook gebruikt voor Frequency Division Multiplexing (FDM) om meerdere signalen over één kabel te sturen.
* **Telefoonkabel:** Gebruikt voor traditionele telefoonlijnen en DSL-internetverbindingen (zoals ADSL en VDSL).
* **Glasvezelkabel (Fiber Optic):** Transmitteert data met behulp van lichtpulsen.
* **Voordelen:**
* Hoge beveiliging (niet gemakkelijk te "hijacken").
* Ondersteunt zeer lange afstanden.
* Ongeëvenaarde snelheden.
* Geen last van EMI/RFI.
* **Nadelen:**
* Hogere kosten.
* Minder flexibel.
* **Typen glasvezel:**
* **SM (Single-Mode):** Gebruikt voor lange afstanden met lasers.
* **MM (Multi-Mode):** Gebruikt voor kortere afstanden met LED's.
#### 2.1.3 Bandbreedte en Doorvoersnelheid
* **Bandbreedte (Bandwidth) of Kanaalcapaciteit:** De theoretische maximale capaciteit van een transmissiemedium om data te verzenden, uitgedrukt in bits per seconde (bps).
* $1000$ bits per seconde = $1$ kilobit per seconde ($1$ kbps).
* Eén miljoen bits per seconde = $1$ megabit per seconde ($1$ Mbps).
* Eén miljard bits per seconde = $1$ gigabit per seconde ($1$ Gbps).
* **Belangrijk:** Bits zijn niet hetzelfde als Bytes!
* **Doorvoersnelheid (Throughput):** De *praktische* capaciteit van een verbinding van eindpunt tot eindpunt, ook uitgedrukt in bps. Dit houdt rekening met factoren zoals vertragingen door netwerkapparatuur en het delen van lijnen door multiplexingtechnieken.
* **Bottleneck:** Het zwakste punt in een netwerkverbinding dat de algehele prestaties beperkt.
### 2.2 Netwerktopologieën
Een netwerktopologie beschrijft de fysieke of logische lay-out van een netwerk, oftewel hoe apparaten met elkaar verbonden zijn.
#### 2.2.1 Fysieke topologieën
Dit zijn de daadwerkelijke fysieke verbindingen tussen apparaten.
* **Maas (Mesh):** Elk apparaat is direct verbonden met elk ander apparaat.
* **Full Mesh:** Elk apparaat heeft een directe verbinding met elk ander apparaat.
* **Partial Mesh:** Slechts enkele apparaten hebben directe verbindingen met elkaar.
* **Bus:** Alle apparaten zijn aangesloten op één centrale kabel (de backbone).
* **Ster (Star):** Alle apparaten zijn verbonden met een centraal punt, zoals een switch of hub.
* **Ring:** Apparaten zijn verbonden in een gesloten lus, waarbij elk apparaat met twee andere is verbonden.
* **Ketting (Chain/Daisy Chain):** Apparaten zijn opeenvolgend met elkaar verbonden.
* **Boom (Tree):** Een hiërarchische topologie die een combinatie is van bus- en stertopologieën.
* **Hybride:** Een combinatie van twee of meer verschillende topologieën.
#### 2.2.2 Logische versus Fysieke topologie
Het is belangrijk onderscheid te maken tussen de fysieke lay-out van de kabels en de manier waarop data daadwerkelijk door het netwerk stroomt (de logische topologie). Een netwerk kan bijvoorbeeld een fysieke stertopologie hebben, maar een logische bus- of ringstructuur (zoals bij oudere Ethernet-hubs).
### 2.3 Het Internet
Het internet is het grootste netwerk ter wereld, een enorm complex netwerk van netwerken dat is opgebouwd met diverse transmissiemedia en protocollen. Het wordt beheerd door Internet Service Providers (ISP's) en maakt gebruik van diverse technologieën voor dataoverdracht, waaronder glasvezelkabels (zowel op land als onderzeese kabels), koperkabels (voor DSL) en satellietverbindingen.
> **Tip:** Het onderscheid tussen bandbreedte en doorvoersnelheid is cruciaal voor het begrijpen van netwerkprestaties. Bandbreedte is de theoretische limiet, terwijl doorvoersnelheid de gemeten, realistische snelheid is.
> **Tip:** Bij het bestuderen van netwerktopologieën, denk na over de voordelen en nadelen van elke topologie met betrekking tot kosten, schaalbaarheid, betrouwbaarheid en prestaties.
> **Voorbeeld:** Een thuisnetwerk met een centrale Wi-Fi router waaraan alle apparaten (laptops, telefoons, smart-tv's) zijn verbonden, is een voorbeeld van een fysieke stertopologie.
---
# Het internet en verbindingsmethoden
Dit onderdeel beschrijft het internet als een wereldwijd netwerk, de rol van internetproviders, en de verschillende methoden voor thuisverbindingen en datatransmissie.
## 3. Het internet en verbindingsmethoden
### 3.1 Het internet
Het internet is het grootste geïnternecteerde netwerk ter wereld en verbindt talloze apparaten wereldwijd.
#### 3.1.1 Internet Service Provider (ISP)
Een Internet Service Provider (ISP) is een bedrijf dat toegang tot het internet biedt aan particulieren en organisaties.
#### 3.1.2 Thuistoegang
Verschillende methoden worden gebruikt om thuis toegang te krijgen tot het internet:
* **Proximus:**
* **Telefoonkabel (POTS - Plain Old Telephone Service):** Een oudere technologie die gebruikmaakt van de bestaande telefoonlijnen.
* **Inbelverbinding:** Een langzame methode die de telefoonlijn gebruikt om verbinding te maken.
* **DSL (Digital Subscriber Line):**
* **HDSL:** Ontworpen voor zakelijk gebruik, kan data over 18 kilometer verzenden met een snelheid van 1 megabit per seconde, maar ondersteunt geen telefonie.
* **ADSL:** Maakt gelijktijdig gebruik van internet en telefonie mogelijk. Kan tot 8 megabits per seconde downstream over een afstand van 4 kilometer verzenden.
* **VDSL:** Biedt hogere snelheden tot 55 megabits per seconde downstream over een kortere afstand van 2 kilometer.
* **ADSL2 en ADSL2+:** Verbeterde versies met respectievelijk 12 en 24 megabits per seconde downstream.
* **VDSL2:** Kan tot 100 megabits per seconde downstream bereiken als de afstand tot de centrale korter is dan 2 kilometer.
* **FTTH (Fiber To The Home):** Een verbinding via glasvezel direct naar de woning, wat de hoogste snelheden en betrouwbaarheid biedt.
* **Telenet:**
* **Coaxkabel (HFC - Hybrid Fiber Coaxial network):** Gebruikt een combinatie van glasvezel en coaxkabel. Maakt gebruik van DOCSIS (Data Over Cable Service Interface Specification) technologie, waarbij DOCSIS 3.1 snelheden tot 10 gigabits per seconde mogelijk maakt. Deze technologie is oorspronkelijk ontwikkeld voor TV-uitzendingen en maakt gebruik van FDM (Frequency Division Multiplexing).
* **TV Vlaanderen:**
* **Satelliet:** Internettoegang via een schotelantenne die signalen ontvangt van een satelliet.
* **Terrestriel:** Internet via grondstations.
### 3.2 Schakelmethoden
Schakelmethoden bepalen hoe data door een netwerk wordt geleid.
#### 3.2.1 Circuit switching
Bij circuit switching wordt een dedicated verbinding (een "circuit") opgezet tussen de zender en de ontvanger voor de duur van de communicatie. Dit is een één-op-één verbinding.
#### 3.2.2 Message switching
Bij message switching wordt de volledige boodschap als één geheel verzonden van knooppunt naar knooppunt. Elk knooppunt slaat de boodschap op en stuurt deze door naar het volgende knooppunt. De route kan variëren.
#### 3.2.3 Packet switching
Packet switching is de meest gebruikte methode op het internet. Data wordt opgedeeld in kleinere eenheden, genaamd pakketten. Elk pakket bevat adresinformatie en wordt onafhankelijk van andere pakketten gerouteerd. Op de bestemming worden de pakketten weer samengevoegd tot de oorspronkelijke boodschap.
> **Tip:** Packet switching is efficiënter dan circuit switching omdat de verbindingsmiddelen gedeeld kunnen worden door meerdere gebruikers tegelijkertijd.
### 3.3 Bandbreedte en doorvoersnelheid
* **Bandbreedte (Bandwidth) of Kanaalcapaciteit:** De theoretische maximale capaciteit van een transmissiemedium om data te verzenden.
* $1000 \text{ bits/s} = 1 \text{ kilobit/s} = 1 \text{ kbps}$
* $1.000.000 \text{ bits/s} = 1 \text{ megabit/s} = 1 \text{ Mbps}$
* $1.000.000.000 \text{ bits/s} = 1 \text{ gigabit/s} = 1 \text{ Gbps}$
> **Tip:** Onthoud dat bits (b) en Bytes (B) verschillend zijn. 1 Byte is gelijk aan 8 bits.
* **Doorvoersnelheid (Throughput):** De daadwerkelijke, praktische capaciteit van een verbinding van eindpunt tot eindpunt, gemeten in bits per seconde (bps). Dit houdt rekening met vertragingen van netwerkapparatuur, ander netwerkverkeer en het delen van lijnen via multiplexingtechnieken zoals TDM of FDM.
* **Bottleneck:** Het zwakste punt in een netwerkverbinding dat de totale doorvoersnelheid beperkt.
---
# Protocollen en gelaagde modellen
Protocollen zijn de regelsystemen die datacommunicatie mogelijk maken, en gelaagde modellen zoals OSI en TCP/IP structureren deze regels voor efficiëntie en modulariteit, waarbij inkapseling een sleutelrol speelt.
### 4.1 Protocollen
Protocollen vormen de basis van datacommunicatie door een reeks regels te definiëren die bepalen hoe gegevens worden uitgewisseld tussen apparaten. Deze regels omvatten onder andere:
* **Formaat:** De structuur van een pakket of bericht.
* **Grootte:** Beperkingen op de omvang van pakketten of berichten.
* **Timing:** De snelheid waarmee gegevens worden verzonden.
* **Codering:** Hoe informatie wordt omgezet in elektrische pulsen of lichtpulsen, met name voor draadloze communicatie.
* **Inkapseling:** Het proces waarbij data wordt verpakt met besturingsinformatie op elke laag van een gelaagd model.
* **Patroon:** De volgorde waarin informatie wordt verwerkt en verzonden.
> **Tip:** Netwerkstandaarden zijn essentiële componenten die zorgen voor interoperabiliteit tussen verschillende apparaten en systemen.
### 4.2 Gelaagde modellen
Gelaagde modellen organiseren de complexiteit van netwerkcommunicatie door specifieke taken of diensten te isoleren in aparte lagen. Dit zorgt voor modulariteit en maakt het mogelijk om aanpassingen te doen in één laag zonder dat dit significante impact heeft op andere lagen. Elke laag gebruikt de diensten van de direct onderliggende laag en biedt diensten aan de direct bovenliggende laag. Deze modellen kunnen zowel hardwarematig als softwarematig worden geïmplementeerd en zijn essentieel voor gedistribueerde communicatie tussen twee of meer eindsystemen.
#### 4.2.1 Het OSI-model
Het Open Systems Interconnection (OSI)-model, ontwikkeld door de International Organization for Standardization (ISO), is een conceptueel model dat de netwerkcommunicatie in zeven lagen onderverdeelt:
* **Applicatielaag (laag 7):** Deze laag biedt de interface voor eindgebruikersapplicaties. Hier bevinden zich applicatieprogramma's, terminals, randapparatuur, databanken en processen die de bron vormen van de te verzenden gegevens. De belangrijkste functie is het faciliteren van informatie-uitwisseling tussen applicatieprocessen.
* **Presentatielaag (laag 6):** De functies in deze laag zorgen voor een juiste presentatie van de informatie voor de eindgebruiker. Dit omvat karaktercodeconversie, commando-conversie, karaktercompressie, gegevensopmaak en encryptie.
* **Sessielaag (laag 5):** Deze laag is verantwoordelijk voor het opzetten, onderhouden en verbreken van de dialoog tussen communicerende partijen. Het beheert de dialoog, lost problemen op en zorgt ervoor dat de communicatie plaatsvindt volgens de afgesproken modus (simplex, half-duplex of full-duplex). Ook wachtwoordgebruik wordt hier afgehandeld.
* **Transportlaag (laag 4):** De transportlaag zorgt voor een betrouwbare end-to-end datatransmissie. Indien een bericht te lang is voor transport, deelt deze laag het op in segmenten en stelt het aan de ontvangstzijde weer samen. Het controleert ook of het volledige bericht foutloos en onveranderd is overgedragen.
* **Netwerklaag (laag 3):** De primaire taak van de netwerklaag is het efficiënt routeren van datapakketten van de bron naar de bestemming. Dit gebeurt met behulp van routeringstabellen in de netwerkapparatuur.
* **Datalinklaag (laag 2):** Deze laag zorgt voor het opzetten, onderhouden en verbreken van logische verbindingen tussen twee stations. Bij communicatie met meerdere tussenliggende apparaten worden er meerdere datalinks gelegd (bijvoorbeeld tussen PC en switch, switch en router).
* **Fysieke laag (laag 1):** De fysieke laag definieert de mechanische en signaalkarakteristieken die nodig zijn voor de fysieke verbinding tussen zender en ontvanger, zoals voltage niveaus, signaalvormen en connectortypes.
#### 4.2.2 Het TCP/IP-model
Het TCP/IP-model is een praktischer en wijdverspreid model, dat de basis vormt van het internet. Het wordt vaak vergeleken met het OSI-model, hoewel het minder lagen heeft. De kerncomponenten van het TCP/IP-model zijn:
* **Applicatielaag:** Vergelijkbaar met de Applicatie-, Presentatie- en Sessielagen van het OSI-model, behandelt deze laag applicatiespecifieke protocollen zoals HTTP, FTP en SMTP. Berichten worden op deze laag gecreëerd.
* **Transportlaag:** Deze laag biedt end-to-end communicatie en diensten zoals betrouwbare dataoverdracht (TCP) of snelle, maar onbetrouwbare overdracht (UDP). Op deze laag worden data opgedeeld in segmenten.
* **Internetlaag:** Vergelijkbaar met de Netwerklaag van het OSI-model, is deze laag verantwoordelijk voor het adresseren en routeren van datapakketten over het netwerk. Paden worden bepaald en de pakketten worden 'packets' genoemd.
* **Netwerktoegangslaag (ook wel Linklaag of Fysieke laag genoemd):** Deze laag combineert de functies van de Datalinklaag en de Fysieke laag van het OSI-model. Het beheert de fysieke transmissie van data over het medium en de toegang tot dat medium. Op deze laag worden de data verpakt in 'frames'.
> **Tip:** Het TCP/IP-model is het model dat daadwerkelijk wordt gebruikt voor de werking van het internet, terwijl het OSI-model meer een theoretisch en referentiemodel is.
#### 4.2.3 Inkapseling
Inkapseling is een cruciaal concept binnen gelaagde modellen. Het proces waarbij data van een hogere laag wordt doorgegeven aan een lagere laag, waarbij elke laag besturingsinformatie (headers en soms trailers) toevoegt die specifiek is voor die laag. Dit zorgt ervoor dat de ontvanger de data correct kan verwerken en aan de juiste applicatie kan afleveren.
Bijvoorbeeld, in het TCP/IP-model:
* Een bericht op de applicatielaag wordt een 'segment' op de transportlaag, met toevoeging van een TCP- of UDP-header.
* Een segment wordt een 'packet' op de internetlaag, met toevoeging van een IP-header.
* Een packet wordt een 'frame' op de netwerktoegangslaag, met toevoeging van een frame-header en mogelijk een trailer.
De ontvanger voert het omgekeerde proces uit: de-inkapseling, waarbij de headers van elke laag worden verwijderd naarmate de data de lagen opwaarts doorloopt, totdat de originele data de applicatielaag bereikt.
> **Voorbeeld:** Stel je voor dat je een brief (data) verstuurt. Je stopt de brief in een envelop (segment/packet/frame). Op de envelop schrijf je het adres van de ontvanger en afzender (IP-header). De postdienst voegt er vervolgens postzegels en sorteerstickers aan toe (andere headers), vergelijkbaar met de inkapseling op de verschillende lagen. Bij aankomst wordt de envelop geopend en wordt de brief bij de juiste persoon bezorgd.
---
## Veelgemaakte fouten om te vermijden
- Bestudeer alle onderwerpen grondig voor examens
- Let op formules en belangrijke definities
- Oefen met de voorbeelden in elke sectie
- Memoriseer niet zonder de onderliggende concepten te begrijpen
Glossary
| Term | Definition |
|------|------------|
| Datacommunicatie | Het proces van het overbrengen van digitale informatie tussen twee of meer apparaten, meestal via een transmissiemedium. Dit omvat de verzending, ontvangst en verwerking van gegevens. |
| Analoge transmissie | Een methode van gegevensverzending waarbij het signaal continu varieert in amplitude, frequentie of fase om de informatie weer te geven. Dit is vaak de basis voor het overbrengen van binaire data op een analoog medium. |
| Digitale transmissie | Een methode van gegevensverzending waarbij de informatie wordt gecodeerd als discrete pulsen, meestal binair (0s en 1s). Dit is betrouwbaarder voor lange afstanden dan analoge transmissie zonder speciale maatregelen. |
| Modulatie | Het proces waarbij informatie wordt overgebracht door de eigenschappen (zoals amplitude, frequentie of fase) van een draaggolf signaal te veranderen in overeenstemming met de te verzenden data. |
| Elektromagnetische golf (EM golf) | Een golf die zich voortplant met de snelheid van het licht en die bestaat uit oscillerende elektrische en magnetische velden die loodrecht op elkaar staan. Deze golven worden gebruikt voor draadloze datacommunicatie. |
| Amplitude | De maximale uitwijking of intensiteit van een golf of trilling ten opzichte van zijn evenwichtspositie. Bij modulatie kan de amplitude van een draaggolf worden aangepast om data te coderen. |
| Frequentie | Het aantal cycli of trillingen van een golf per seconde, gemeten in Hertz (Hz). Frequentie is een belangrijke eigenschap van draaggolf signalen die wordt gebruikt bij frequentiemodulatie. |
| Fase | De relatieve positie van een punt op een golfvorm ten opzichte van een referentiepunt, vaak uitgedrukt als een hoek. Faseverschillen kunnen worden gebruikt om data te coderen tijdens faseverschuivingsmodulatie. |
| Multiplexen | Een techniek die wordt gebruikt om meerdere datastromen over een enkel transmissiekanaal te verzenden, waardoor het gebruik van de beschikbare bandbreedte wordt geoptimaliseerd en lijnen worden bespaard. |
| Time Division Multiplexing (TDM) | Een multiplexingtechniek waarbij de bandbreedte van het kanaal wordt verdeeld in discrete tijdsleuven, en elke datastroom krijgt een eigen tijdsleuf toegewezen om te zenden. |
| Frequency Division Multiplexing (FDM) | Een multiplexingtechniek waarbij het totale beschikbare frequentiebereik van een communicatiekanaal wordt verdeeld in verschillende subkanalen van lagere frequentiebanden, die elk een afzonderlijke datastroom kunnen dragen. |
| Simplex | Een communicatierichting waarbij data slechts in één richting kan worden verzonden; zenden en ontvangen kan niet tegelijkertijd plaatsvinden. |
| Half-duplex | Een communicatierichting waarbij data in beide richtingen kan worden verzonden, maar niet tegelijkertijd. Beide partijen kunnen zenden en ontvangen, maar niet op hetzelfde moment. |
| Duplex (Full-duplex) | Een communicatierichting waarbij data gelijktijdig in beide richtingen kan worden verzonden. Dit maakt een ononderbroken tweerichtingscommunicatie mogelijk. |
| Unicast | Een communicatiemethode waarbij een pakket van een bron naar één specifieke bestemming wordt gestuurd. |
| Multicast | Een communicatiemethode waarbij een pakket van een bron naar een groep geselecteerde bestemmingen wordt gestuurd. |
| Broadcast | Een communicatiemethode waarbij een pakket van een bron naar alle mogelijke bestemmingen op een netwerk wordt gestuurd. |
| Bandbreedte (Bandwidth) | De theoretische maximale capaciteit van een transmissiekanaal om gegevens per tijdseenheid te verzenden, meestal uitgedrukt in bits per seconde (bps). |
| Doorvoersnelheid (throughput) | De werkelijke praktische capaciteit van een transmissiekanaal om gegevens per tijdseenheid te verzenden, rekening houdend met factoren zoals vertragingen en netwerkcongestie. |
| Bottleneck | Een zwak punt in een netwerkverbinding dat de algehele prestaties beperkt, vaak een apparaat of een verbinding met een lagere capaciteit dan andere delen van het netwerk. |
| Transmissiemedium | Het fysieke pad dat wordt gebruikt om gegevens te verzenden, zoals kabels (koper, glasvezel) of de ether (voor draadloze communicatie). |
| Frequentiespectrum | Het bereik van alle mogelijke elektromagnetische frequenties die kunnen worden gebruikt voor draadloze communicatie. |
| Antenne | Een apparaat dat elektromagnetische golven uitzendt of ontvangt, cruciaal voor draadloze datacommunicatie. Verschillende soorten antennes zijn geoptimaliseerd voor specifieke frequenties en toepassingen. |
| Koperkabel | Een transmissiemedium dat bestaat uit koperdraden, zoals UTP, coaxkabel en telefoonkabel, gebruikt voor het verzenden van elektrische signalen. |
| UTP (Unshielded Twisted Pair) | Een type koperkabel dat bestaat uit paren van geïsoleerde koperdraden die rond elkaar zijn gedraaid om interferentie te verminderen. |
| Coaxkabel | Een type koperkabel met een centrale geleider omgeven door een isolerende laag en een gevlochten metalen afscherming, die beschermt tegen elektromagnetische interferentie. |
| Glasvezelkabel (Fiber optic cable) | Een transmissiemedium dat bestaat uit dunne vezels van glas of plastic die lichtsignalen gebruiken om data over lange afstanden te verzenden met hoge snelheden. |
| Netwerktopologie | De fysieke of logische rangschikking van de elementen (zoals computers en kabels) in een computernetwerk. |
| Maas (Mesh) | Een netwerktopologie waarbij elk apparaat direct is verbonden met elk ander apparaat (full mesh) of met meerdere andere apparaten (partial mesh), wat hoge redundantie biedt. |
| Bus | Een netwerktopologie waarbij alle apparaten zijn aangesloten op één centrale kabel (de bus). Dit is een eenvoudige maar minder betrouwbare topologie. |
| Ster | Een netwerktopologie waarbij alle apparaten zijn aangesloten op een centraal punt, zoals een switch of hub. Dit is een veelgebruikte en beheersbare topologie. |
| Ring | Een netwerktopologie waarbij apparaten in een gesloten lus zijn verbonden, waarbij data van apparaat naar apparaat gaat totdat het de bestemming bereikt. |
| Hybride topologie | Een netwerktopologie die twee of meer verschillende topologieën combineert om de voordelen van elk te benutten. |
| Logische topologie | Beschrijft hoe gegevens daadwerkelijk door het netwerk stromen, ongeacht de fysieke verbindingen. |
| Fysieke topologie | Beschrijft de daadwerkelijke fysieke lay-out van de kabels en apparaten in een netwerk. |
| Internet Service Provider (ISP) | Een bedrijf dat toegang tot het internet en gerelateerde diensten aanbiedt aan individuen en organisaties. |
| DSL (Digital Subscriber Line) | Een familie van technologieën die digitale gegevens over de koperen telefoonlijnen van een telecommunicatiebedrijf verzenden, wat snellere internettoegang mogelijk maakt dan traditionele inbelverbindingen. |
| FTTH (Fiber to the Home) | Een type glasvezelverbinding die de glasvezelkabel rechtstreeks tot in de woning van de abonnee brengt, wat zeer hoge snelheden mogelijk maakt. |
| DOCSIS (Data Over Cable Service Interface Specification) | Een standaard voor de transmissie van gegevens over kabeltelevisienetwerken, waardoor breedbandinternet via coaxkabels mogelijk wordt. |
| Circuit switching | Een schakelmethode waarbij een dedicated communicatiepad (circuit) wordt opgezet tussen twee communicerende partijen voor de duur van de communicatie. |
| Message switching | Een schakelmethode waarbij volledige berichten worden verzonden van knooppunt naar knooppunt en op elk knooppunt tijdelijk worden opgeslagen voordat ze naar het volgende knooppunt worden doorgestuurd. |
| Packet switching | Een schakelmethode waarbij gegevens worden opgedeeld in kleine pakketten, die onafhankelijk van elkaar via het netwerk worden verzonden en op de bestemming weer worden samengevoegd. |
| Protocol | Een set regels en procedures die bepalen hoe apparaten in een netwerk met elkaar communiceren, inclusief de syntaxis, semantiek en timing van de berichten. |
| Gelaagd model | Een conceptueel raamwerk dat netwerkcommunicatie opdeelt in een reeks lagen, waarbij elke laag specifieke functies uitvoert en diensten levert aan de laag erboven. |
| OSI Model (Open Systems Interconnection Model) | Een 7-laags conceptueel model dat netwerkcommunicatie standaardiseert, waardoor verschillende systemen met elkaar kunnen interageren. |
| TCP/IP Model | Een 4- of 5-laags netwerkmodel dat de basis vormt van het internet, waarbij lagen zoals de Netwerktoegangslaag, Internetlaag, Transportlaag en Applicatielaag worden gedefinieerd. |
| Inkapseling | Het proces waarbij gegevens van een hogere netwerklaag worden verpakt met protocolinformatie van de huidige laag, zodat het als een eenheid door de lagere lagen kan worden verzonden. |
| Applicatielaag | De bovenste laag in netwerkmodellen die direct interactie heeft met de eindgebruikerstoepassingen en gegevens levert aan de presentatielaag. |
| Presentatielaag | De laag die verantwoordelijk is voor de weergave, codering en encryptie van gegevens, zodat ze begrijpelijk zijn voor de applicatielaag van de ontvangende partij. |
| Sessielaag | De laag die verantwoordelijk is voor het opzetten, beheren en beëindigen van communicatiesessies tussen applicaties op verschillende systemen. |
| Transportlaag | De laag die zorgt voor end-to-end datatransport tussen processen op verschillende hosts, inclusief betrouwbare overdracht en flow control. |
| Netwerklaag | De laag die verantwoordelijk is voor het routeren van datapakketten van de bron naar de bestemming over verschillende netwerken heen. |
| Datalinklaag | De laag die zorgt voor betrouwbare gegevensoverdracht tussen twee direct verbonden knooppunten over een fysieke verbinding, inclusief foutdetectie en -correctie. |
| Fysieke laag | De onderste laag in netwerkmodellen die verantwoordelijk is voor de fysieke overdracht van bits over het transmissiemedium, inclusief elektrische, mechanische en procedurele specificaties. |
Cover
eitf45 -L1- introduction.pdf
Summary
# Evolution of computer communications and the internet
This topic outlines the historical development of telecommunications, tracing the path from early electrical communication methods to the establishment of the modern internet [3](#page=3) [7](#page=7) [8](#page=8) [9](#page=9).
### 1.1 Early telecommunications
The foundation of modern computer communications can be traced back to the 19th century with the advent of the electrical telegraph, which saw its initial deployment at the beginning of the century and later spanned across the Atlantic. Following this, telephony was patented in 1876, and the demand for this technology increased rapidly [3](#page=3).
### 1.2 The concept of circuit switching
Circuit switching is a communication method where all data exchanged between a sender and receiver travels along a single, predefined path. This established a dedicated connection for the duration of the communication session [4](#page=4).
### 1.3 The emergence of packet switching
The 1960s marked a significant shift with the first publications suggesting packet switching as an alternative to circuit switching. This innovative approach proposed breaking data into smaller units called packets [5](#page=5).
### 1.4 The ARPANET project
The Advanced Research Projects Agency Network, or ARPANET, was conceptualized to address the need for a unified communication system. Robert Taylor of ARPA articulated the vision for a network where a single terminal could connect to any system, using a common language for communication. He highlighted the inefficiency of having multiple terminals and login procedures for different systems. This idea directly led to the development of the ARPANET [6](#page=6).
The ARPANET officially began in 1969. It was the first packet-switched network and initially connected four university sites: UCLA (University of California, Los Angeles), SRI (Stanford Research Institute), UCSB (University of California, Santa Barbara), and the University of Utah [7](#page=7).
### 1.5 Internet evolution and standardization
The growth of the internet necessitated common languages, or protocols, for terminals and switches to communicate effectively. It also required a system for identification, leading to the development of addresses. To facilitate the scaling up of these interconnected networks, Robert E. Kahn and Vincent Cerf developed an "internetwork protocol" in 1973. This protocol was later standardized as TCP/IP (Transmission Control Protocol/Internet Protocol) in 1982 [8](#page=8).
### 1.6 The internet today
Currently, the internet has evolved into a converged network supporting a wide range of services, including data communication, IPTV, Video on Demand, broadcast radio, and telephony, among others. From a user's perspective, the internet provides access to these diverse services while from an engineer's view, it represents a complex infrastructure enabling these connections [10](#page=10) [11](#page=11) [9](#page=9).
---
# Network models and layered architecture
Network models, particularly the Internet Protocol suite (TCP/IP model), are essential for organizing digital communications through a layered architecture. This approach is rooted in the "divide and conquer" principle, aiming to simplify the complex process of sending data across networks [13](#page=13) [14](#page=14).
### 2.1 Benefits of a layered architecture
A layered architecture offers several significant advantages for managing the complexities of digital communications [14](#page=14):
* **Specialization:** Each layer is responsible for a specific set of functions and services. This allows for specialized development and optimization within each layer, rather than trying to handle all aspects of communication in a monolithic design [14](#page=14).
* **Simplification:** By breaking down the overall communication process into smaller, manageable layers, the design and implementation become significantly simpler. Developers can focus on one layer at a time without needing to understand the intricate details of all other layers [14](#page=14).
* **Managing complexity:** Digital communication involves many distinct tasks, from handling physical signals to running user applications. A layered architecture effectively segments these tasks, making the entire system easier to understand, build, and maintain [14](#page=14) [15](#page=15).
### 2.2 Components of a layered architecture
A typical layered architecture for digital communications can be conceptually understood by considering the journey of data:
* **Digital communications:** This encompasses the entire process, starting from raw electrical signals and progressing through the representation of data as bits, and finally to the formation of packets for transmission [15](#page=15).
* **Using the physical infrastructure (Network access):** This layer deals with the physical transmission of data over the network medium. It defines how data is encoded into signals and transmitted through devices like cables or wireless interfaces [15](#page=15).
* **Finding your way (Addressing, routing):** This layer is responsible for ensuring data reaches its intended destination. It involves mechanisms for identifying devices (addressing) and determining the best paths for data to travel across the network (routing) [15](#page=15).
* **Making use of it all (Applications):** This is the topmost layer, where user-facing applications interact with the network. Examples include web browsers, email clients, and file transfer programs [15](#page=15).
The network model provides a framework for understanding these different functional layers and how they interact to enable communication [26](#page=26).
> **Tip:** When studying network models, visualize data flowing down through the layers on the sending side and up through the layers on the receiving side. Each layer adds or removes its own header information as the data passes through.
---
# Application layer paradigms and the World Wide Web
This section explores fundamental application layer paradigms and delves into the architecture and components of the World Wide Web.
### 3.1 Application layer paradigms
The application layer in computer networking provides services directly to user applications. Two prominent paradigms exist for structuring these services: client-server and peer-to-peer [16](#page=16).
#### 3.1.1 Client-server paradigm
In the client-server paradigm, dedicated servers provide resources or services to multiple clients. Clients initiate requests, and servers respond to them. This model is widely used for applications like web browsing, email, and file sharing [17](#page=17).
Performance challenges in the client-server model include:
* The need for standardized protocols like HTTP to manage communication [18](#page=18).
* Heavy traffic loads that can overload servers [18](#page=18).
* Delays caused by congested access networks [18](#page=18).
* The risk of a single point of failure, where the server's unavailability disrupts service for all clients [18](#page=18).
#### 3.1.2 Peer-to-peer paradigm
In contrast, the peer-to-peer (P2P) paradigm allows each node in a network to act as both a client and a server. Participants can share resources and services directly with each other without relying on a central server. P2P networks can offer increased scalability and robustness, as the failure of one node does not necessarily impact the entire network [19](#page=19).
### 3.2 The World Wide Web (WWW)
The World Wide Web (WWW) was initially proposed by Tim Berners-Lee in 1989 at CERN with the goal of enabling researchers at different locations to access each other's findings. The commercialization of the WWW began in 1993 [20](#page=20).
#### 3.2.1 Components of the WWW
The WWW is comprised of several key components [21](#page=21):
* **Web documents (pages):** These are the content accessed via the web.
* **Static documents:** Primarily created using HyperText Markup Language (HTML) [21](#page=21).
* **Dynamic documents:** Generated by script languages such as PHP, ASP, JSP, and CGI [21](#page=21).
* **Universal Resource Locator (URL):** A standardized method for identifying the location of web documents [21](#page=21).
* **HyperText Transfer Protocol (HTTP):** The protocol used to access documents from a web server [21](#page=21).
#### 3.2.2 Universal Resource Locator (URL)
A web document is identified by four components: protocol, host, port, and path. The general format of a URL is [22](#page=22):
`protocol://host:port/path`
The standard HTTP port is 80, which can often be omitted. An example URL is `http://www.eit.lth.se/course/etsf15` [22](#page=22).
#### 3.2.3 HyperText Transfer Protocol (HTTP)
HTTP is a text-based protocol used for communication on the web. It facilitates two primary types of messages: requests and responses. HTTP establishes and utilizes a TCP connection for its operations [23](#page=23).
> **Tip:** HTTP is a stateless protocol, meaning each request is independent and the server does not retain information about previous client requests.
The diagram shows typical HTTP request and response interactions. Common HTTP methods include GET and PUT. The process of retrieving a document involves these HTTP exchanges [24](#page=24) [25](#page=25).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Electrical telegraph | An early 19th-century telecommunications technology used for transmitting messages over long distances using electrical signals, predating widespread telephony. |
| Telephony | A telecommunications system that transmits voice or other sounds over distances, typically using electrical signals, patented in 1876. |
| Circuit switching | A network communication method where a dedicated, predefined path is established between two endpoints for the duration of a communication session. |
| Packet switching | A network communication method where data is broken down into smaller units called packets, each routed independently across the network and reassembled at the destination. |
| ARPANET | The Advanced Research Projects Agency Network, established in 1969, which was the first operational packet-switched network and a precursor to the modern internet. |
| Protocol | A set of rules or procedures governing the exchange or transmission of data between electronic devices, ensuring compatible communication. |
| Internetwork protocol | A protocol designed to enable communication between different types of networks, forming an internetwork. TCP/IP is a prominent example. |
| TCP/IP | Transmission Control Protocol/Internet Protocol, a suite of communication protocols used to interconnect network devices on the internet. |
| Network model | A conceptual framework that standardizes the functions of a communication system by dividing it into distinct layers, such as the TCP/IP model or OSI model. |
| Layered architecture | A design principle in networking where the overall system is divided into a series of layers, with each layer performing a specific function and interacting with the layers immediately above and below it. |
| Physical infrastructure | The tangible components of a network, including cables, switches, routers, and other hardware, that support data transmission. |
| Addressing | The process of assigning unique identifiers to devices or locations within a network to enable data to be directed to the correct destination. |
| Routing | The process of selecting paths in a network along which to send network traffic, determining the best route for data packets. |
| Applications | Software programs that utilize network services to perform specific user tasks, such as web browsing, email, or file transfer. |
| Client-server paradigm | A distributed application structure that partitions tasks or workloads between providers of a resource or service, called servers, and service requesters, called clients. |
| Peer-to-peer paradigm | A distributed application architecture that partitions tasks or workloads between peers, where each peer can act as both a client and a server. |
| World Wide Web (WWW) | An information system on the internet that allows documents to be connected to other documents by hypertext links, enabling the user to search for information by moving from one document to another. |
| HyperText Markup Language (HTML) | The standard markup language for documents designed to be displayed in a web browser, defining the structure and content of web pages. |
| Dynamic web pages | Web pages that are generated in real-time based on user input or other variables, often using scripting languages. |
| Universal Resource Locator (URL) | A web address that specifies the location of a resource on the internet, including the protocol, host, port, and path. |
| HyperText Transfer Protocol (HTTP) | An application protocol for distributed, collaborative, hypermedia information systems, commonly used to transfer data over the World Wide Web. |
| GET | An HTTP request method used to retrieve data from a specified resource. |
| PUT | An HTTP request method used to upload a representation of the specified resource. |
Cover
eitf45 -L2- physical layer.pdf
Summary
# Introduction to data and signals
This section differentiates between static data representations for storage and dynamic signals for transmission, covering analog and digital signal characteristics [3](#page=3).
### 1.1 Data vs. signal
Data and signals represent information differently, catering to distinct purposes in computer communications [4](#page=4).
* **Data:** Data is a static representation of information primarily used for storage. It is a fixed representation of a message or value [4](#page=4).
* **Signal:** A signal is a dynamic representation of information employed for transmission. Signals are time-varying physical quantities that carry information through a medium [4](#page=4).
### 1.2 Analog vs. digital signals
The fundamental distinction between analog and digital signals lies in their continuity and representation of amplitude [5](#page=5).
* **Analog signals:**
* Are continuous in both time and amplitude [5](#page=5).
* Vary smoothly over time and can take on any value within a given range.
* Are often represented in the electrical or optical domain [5](#page=5).
* An example of an analog signal is a continuous waveform, often depicted as a smooth curve over time [5](#page=5).
* **Digital signals:**
* Are discrete in both time and amplitude [5](#page=5).
* Exist at specific points in time and can only take on a limited set of predefined values, typically binary (0s and 1s) [5](#page=5).
* Are characterized by their binary representation [5](#page=5).
* An example of a digital signal is a series of distinct pulses or levels representing binary data [5](#page=5).
> **Tip:** Understanding the difference between analog and digital signals is crucial for comprehending how information is stored and transmitted in computer networks. Analog signals are often the raw form of information, which then needs to be digitized for efficient and reliable transmission over digital communication systems [3](#page=3) [4](#page=4) [5](#page=5).
---
# Digitalization of analog signals
The digitalization of analog signals is a fundamental process in computer communications, transforming continuous analog signals into a discrete digital format through three primary steps: sampling, quantization, and encoding [6](#page=6).
### 2.1 The three key steps of digitalization
The conversion of an analog signal into a digital representation involves a sequence of distinct operations [6](#page=6).
#### 2.1.1 Sampling
Sampling is the process of discretizing a continuous signal in time. An analog signal, denoted as $s(t)$, is converted into a sequence of samples, $s_n$, at regular intervals. The time between consecutive samples is called the sampling time, $T_s$, and the reciprocal of this, $F_s = 1/T_s$, is the sampling frequency. It is crucial to retain information about the sampling time to accurately reconstruct the original signal [6](#page=6) [7](#page=7).
The **Shannon-Nyquist Sampling Theorem** provides the theoretical basis for sampling. It states that if a continuous signal $s(t)$ is band-limited, meaning its highest frequency component is $F_{max}$, then the signal can be uniquely determined and perfectly reconstructed from its samples $s_n = s(nT_s)$ if and only if the sampling frequency $F_s$ is greater than or equal to twice the highest frequency component ($F_s \geq 2F_{max}$). The term $F_s/2$ is known as the Nyquist frequency, and $2F_{max}$ is the Nyquist rate [8](#page=8).
> **Example:** Telephony voice signals typically occupy frequencies from 0 to 4 kHz. According to the Nyquist theorem, the sampling frequency must be at least $2 \times 4 \text{ kHz} = 8 \text{ kHz}$. If an 8-bit encoding is used for each sample, the data rate for telephony would be $8000 \text{ samples/second} \times 8 \text{ bits/sample} = 64,000 \text{ bits/second}$, or 64 kbps [9](#page=9).
#### 2.1.2 Aliasing
A critical issue that arises if the sampling frequency is too low is **aliasing**. Aliasing occurs when a signal's frequency components higher than $F_s/2$ are misinterpreted as lower frequencies, leading to distortion and an inability to reconstruct the original signal accurately. This happens because the sampling process effectively folds the higher frequency components into the baseband range. To avoid aliasing, it is essential to ensure the sampling rate is at least twice the highest frequency present in the signal [11](#page=11) [8](#page=8).
> **Tip:** To prevent aliasing in practice, anti-aliasing filters (low-pass filters) are often used before sampling to remove frequencies above $F_s/2$.
#### 2.1.3 Quantization
Quantization is the process of discretizing the amplitude of the sampled signal. Each sample, which is a continuous amplitude value, is mapped to one of a finite number of discrete levels. For $k$ bits, there are $M = 2^k$ equidistant quantization levels. Each sample is then represented by a $k$-bit binary word corresponding to its assigned amplitude level [12](#page=12) [6](#page=6).
The difference between the original sample's amplitude and its quantized level is the **quantization error** or distortion. This error is an inherent part of the quantization process and contributes to noise in the digitized signal [13](#page=13).
For a uniform quantizer and assuming a uniformly distributed input signal, the average distortion is given by $D^2/12$, where $D$ is the range of the input signal divided by the number of quantization levels. A common metric to assess the quality of quantization is the **Signal-to-Quantization Noise Ratio (SQNR)**. For a uniform quantizer, it can be expressed as:
$$SQNR = \frac{E[X^2]}{E[(X - X_Q)^2]} = \frac{(M\Delta)^2/12}{\Delta^2/12} = M^2$$
where $M$ is the number of quantization levels and $\Delta$ is the step size between levels [13](#page=13).
In decibels, this becomes:
$$SQNR_{dB} = 10 \log_{10}(M^2) = 20 \log_{10}(M)$$
Since $M=2^k$, where $k$ is the number of bits, the SQNR can also be expressed as:
$$SQNR_{dB} = 20 \log_{10}(2^k) = k \cdot 20 \log_{10} \approx k \cdot 6 \text{ dB}$$ [2](#page=2).
This formula indicates that for every additional bit used in quantization, the SQNR increases by approximately 6 dB [13](#page=13).
#### 2.1.4 Encoding
Encoding is the final step, where the quantized amplitude levels are represented using binary codes. Each discrete amplitude level is assigned a unique binary code word of a specific length, typically determined by the number of quantization levels ($k$ bits for $M=2^k$ levels). This binary representation is the digital signal that can be transmitted or stored [14](#page=14) [6](#page=6).
> **Example:** For CD audio, music signals have frequencies up to 20 kHz. Thus, the sampling frequency is $2 \times 20 \text{ kHz} = 40 \text{ kHz}$. With 16-bit encoding, each sample is represented by 16 bits. The data rate for CD audio is $44,100 \text{ Hz} \times 16 \text{ bits} = 705,600 \text{ bits/second}$. For stereo audio (2 channels), this rate doubles to approximately 1.4 Mbps [15](#page=15).
---
# Transmission media and digital transmission techniques
This topic explores the physical pathways for data transmission and the methods used to represent digital information as signals [3](#page=3).
### 3.1 Transmission media
Transmission media are the physical conduits through which data travels, categorized into guided and unguided types [17](#page=17).
#### 3.1.1 Guided media
Guided media physically confine the signal and include:
* **Twisted pair copper cables**: Consist of two copper wires twisted around each other to reduce electrical disturbances. They are commonly used for telephony loops (e.g., CAT3) and Ethernet (e.g., CAT5, CAT6) [18](#page=18).
* **Coaxial cable**: While mentioned as a category, specific details are not provided in the provided text.
* **Optical fibre**: Transmits data using light pulses through a glass core, relying on total internal reflection. It offers very high capacity, low attenuation and noise, and is not susceptible to radio interference. There are two main types [19](#page=19):
* **Multi-mode**: Typically 50-100 µm in diameter [19](#page=19).
* **Single-mode**: Typically 5-10 µm in diameter [19](#page=19).
#### 3.1.2 Unguided media
Unguided media, also known as wireless media, broadcast signals through the air and include:
* **Radio**: Used in cellular (mobile) networks with ranges of 2-3 km Wi-Fi (around 50 m) Bluetooth (around 10 m) NFC (around 5 cm) and LoRa (IoT) networks (5-15 km) [20](#page=20).
* **Light**: This includes infrared or visible light, though specific applications are not detailed in the provided text.
### 3.2 Digital transmission techniques
Digital transmission involves converting binary data into analog signals to transmit it through a continuous medium. This can be achieved through baseband transmission or by modulating a carrier signal [21](#page=21).
#### 3.2.1 Baseband transmission
Baseband transmission sends digital signals directly without modulating them onto a higher frequency carrier. The signal's spectrum is concentrated at low frequencies, ideally starting from DC. Different line coding schemes are used to represent bits as voltage levels [21](#page=21):
* **On-off keying (OOK)**: Represents a '1' with an "on" signal (amplitude A) and a '0' with an "off" signal (amplitude 0) for the duration of a bit interval ($T_b$). The signal can be represented as $s(t) = A \cdot x$ for $0 \leq t \leq T_b$ where $x$ is the bit value [22](#page=22).
> **Example**: A bit sequence `10010010101111100` would be transmitted as alternating pulses of amplitude A and no pulse (amplitude 0) [22](#page=22).
* **Bipolar signalling**: Uses two signal amplitude levels, +A and -A, to represent bits. For instance, +A could represent a '1' and -A a '0'. The signal can be represented as $a(t) = A \cdot (-1)^x$ for $0 \leq t \leq T_b$ where $x$ is the bit value [23](#page=23).
> **Tip**: Bipolar signalling is often preferred over unipolar signalling (like OOK) as it has a DC component of zero on average, which is beneficial for transmission over some media [23](#page=23).
* **Non-Return to Zero (NRZ)**: In NRZ encoding, a pulse maintains its level throughout the entire bit interval ($T_b$) [24](#page=24).
> **Tip**: NRZ is a common and simple encoding scheme. However, it can lead to long strings of identical bits, which can cause clocking issues at the receiver if not handled properly.
* **Return to Zero (RZ)**: In RZ encoding, the pulse returns to zero for a portion of the bit interval. This ensures a transition within each bit period, which aids in clock synchronization. RZ can be implemented using electrical or optical signals [24](#page=24) [25](#page=25).
> **Example**: An RZ pulse might be high for the first half of the bit interval and then drop to zero for the second half.
* **Manchester coding**: This scheme encodes bits by splitting each bit interval ($T_b$) into two halves. A transition occurs in the middle of each bit period. A transition from low to high (or high to low) in the first half, followed by the opposite transition in the second half, can represent a '1', while the opposite pattern represents a '0'. Alternatively, a mid-bit transition can represent the bit value, e.g., a transition from negative to positive for a '1' and positive to negative for a '0' [26](#page=26).
> **Exam Question Insight**: Manchester encoding can be thought of as two combined signals, often related to the clock and data signals [28](#page=28).
* **Differential Manchester coding**: This method uses a zero transition at the start of each signal time slot to indicate the data. For a transmitted '0', the same pulse pattern as the previous slot is used. For a transmitted '1', the inverted pulse pattern is used, meaning $a_t \neq a_{t-1}$ [27](#page=27).
> **Exam Question Insight**: This scheme uses a transition at the start of each bit period to signal, and the presence or absence of a mid-bit transition determines the bit value [27](#page=27).
#### 3.2.2 Carrier transmission (Modulation)
Carrier transmission, also known as analog transmission, involves modulating a carrier signal with the digital data. This is useful for transmitting digital data over channels that are designed for analog signals, such as radio waves or telephone lines. Common modulation techniques include [21](#page=21) [29](#page=29):
* **ASK (Amplitude Shift Keying)**: A form of OOK applied to a carrier frequency ($f_0$). The amplitude of the carrier signal is varied to represent digital data. For example, a '1' could be represented by a carrier wave with amplitude A, and a '0' by no carrier wave (amplitude 0) [30](#page=30).
> **Formula**: $s(t) = A \cdot x \cdot \cos(2\pi f_0 t)$ for $0 \leq t \leq T_b$, where $x$ is the bit value [30](#page=30).
* **BPSK (Binary Phase Shift Keying)**: Uses an NRZ signal at a carrier frequency ($f_0$) and encodes information in the phase of the carrier wave. For example, a '1' might be represented by a cosine wave, and a '0' by a cosine wave shifted by 180 degrees (i.e., a negative cosine wave) [31](#page=31).
> **Formula**: $s(t) = A \cdot \cos(2\pi f_0 t + \phi)$ where $\phi$ changes based on the bit value [31](#page=31).
* **PAM (Pulse Amplitude Modulation)**: This technique uses discrete amplitude levels to represent data. Bipolar signalling is a binary form of PAM where data is stored in the amplitude transmitted with a pulse shape $g(t)$. The signal can be represented as $a(t) = a_n \cdot g(t)$, where $a_n$ represents the amplitude level for the $n$-th symbol [32](#page=32).
* **M-PAM**: An extension of PAM where $M$ different amplitude levels are used to represent $k = \log_2(M)$ bits per symbol. This allows for more efficient data transmission by encoding multiple bits within a single symbol [33](#page=33).
> **Example**: In 4-PAM, there are $M=4$ amplitude levels, meaning $k = \log_2 = 2$ bits can be represented by each symbol. For instance, levels might represent `00`, `01`, `10`, and `11` [33](#page=33) [34](#page=34) [4](#page=4).
> **Example**: 8-PAM uses $M=8$ amplitude levels, allowing for $k = \log_2 = 3$ bits per symbol to be transmitted [34](#page=34) [8](#page=8).
---
# Channel impairments and lecture summary
This section details common physical impairments that affect communication channels and provides a summary of the lecture's key topics concerning the physical layer.
### 4.1 Channel impairments
Communication channels are subject to several impairments that can degrade the quality of transmitted signals. These impairments can lead to errors in the received data and necessitate robust error detection and correction mechanisms. The primary impairments discussed are attenuation, distortion, noise, and multipath propagation [35](#page=35).
The received signal $y(t)$ can be generally modeled as the transmitted signal $x(t)$ convolved with the channel's impulse response $h(t)$, plus additive noise $n(t)$. This can be represented as [35](#page=35):
$$y(t) = x(t) \ast h(t) + n(t)$$
#### 4.1.1 Attenuation
Attenuation refers to the gradual loss of signal strength as it travels through a communication medium. This loss occurs due to energy dissipation in the medium, such as resistance in wires or absorption in the air. As signals attenuate, their amplitude decreases, making them more susceptible to being corrupted by noise. Amplifiers are often used to compensate for attenuation, but they can also amplify noise [35](#page=35).
#### 4.1.2 Distortion
Distortion occurs when the shape of the transmitted signal is altered as it passes through the channel. This can happen if different frequency components of a signal are delayed by different amounts (delay distortion) or if the amplitude-frequency response of the channel is not uniform. Distortion can cause intersymbol interference (ISI), where the tail of one symbol encroaches upon the next, leading to errors in decoding [35](#page=35).
#### 4.1.3 Noise
Noise is any unwanted signal that interferes with the transmitted signal. Noise can originate from various sources, including thermal noise (random motion of electrons), crosstalk (interference from adjacent channels), and external interference (e.g., from electrical equipment). Noise is often random and can be additive, meaning it is simply added to the signal [35](#page=35).
#### 4.1.4 Multipath propagation (fading)
Multipath propagation occurs when a signal travels through multiple paths from the transmitter to the receiver. This is common in wireless communication due to reflections, diffractions, and scattering of the signal off objects. The different paths can cause the signal components to arrive at the receiver at different times and with different amplitudes and phases. This can lead to constructive or destructive interference, resulting in signal strength fluctuations known as fading [35](#page=35).
### 4.2 Lecture summary: Physical layer
The lecture's summary of the physical layer covers fundamental concepts related to data representation, transmission media, and signal transmission methods [36](#page=36).
#### 4.2.1 Data and signal
A key distinction is made between data (the information itself) and the signal (the physical representation of that data for transmission). The lecture discusses the difference between analog signals (continuous in time and amplitude) and digital signals (discrete in time and amplitude) [36](#page=36).
#### 4.2.2 Digitalisation of analog signals
The process of converting analog signals into digital signals involves several steps [36](#page=36):
* **Sampling:** Measuring the analog signal's amplitude at regular intervals in time. The sampling rate must be at least twice the highest frequency component of the signal (Nyquist theorem).
* **Quantisation:** Assigning a discrete amplitude level to each sampled value. This process introduces quantisation error.
* **Encoding:** Representing the quantised amplitude levels using binary codes.
#### 4.2.3 Transmission media
Various physical media are used for signal transmission, including guided media (e.g., twisted-pair cable, coaxial cable, fiber optic cable) and unguided media (e.g., radio waves, microwaves). The choice of medium affects signal characteristics, data rates, and susceptibility to impairments [36](#page=36).
#### 4.2.4 Transmission
The lecture outlines two primary methods of signal transmission [36](#page=36):
* **Digital transmission:** This can be either baseband transmission (where the digital signal is sent directly over the medium without modulation) or involve the use of a carrier signal.
* **Analog transmission:** This involves modulation, where digital data is used to modify the characteristics (amplitude, frequency, or phase) of an analog carrier signal.
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Data | A static representation of information, typically used for storage. |
| Signal | A dynamic representation of information, used for transmission. |
| Analog Signal | A signal characterized by continuous time and continuous amplitude. |
| Digital Signal | A signal characterized by discrete time and discrete amplitude, often represented in a binary format. |
| Sampling | The process of discretizing a continuous signal in time to obtain discrete time samples. |
| Sampling Frequency | The rate at which a continuous signal is sampled, denoted as $F_s$, where $F_s = 1/T_s$ and $T_s$ is the sampling time. |
| Shannon-Nyquist Sampling Theorem | States that a band-limited signal with a highest frequency component $F_{max}$ can be uniquely determined by its samples if the sampling frequency $F_s$ is at least twice the highest frequency component ($F_s \geq 2F_{max}$). |
| Nyquist Frequency | Half of the sampling frequency ($F_s/2$), representing the maximum frequency component that can be accurately captured by sampling. |
| Nyquist Rate | The minimum sampling frequency required to avoid aliasing, which is twice the maximum frequency of the signal ($2F_{max}$). |
| Aliasing | An effect that occurs when a signal is sampled at a rate lower than the Nyquist rate, causing higher frequencies to appear as lower frequencies in the sampled data, distorting the original signal. |
| Quantization | The process of discretizing the amplitude of a sampled signal, mapping continuous amplitude values to a finite set of discrete levels. |
| Encoding | The process of representing the quantized amplitude levels of a signal using a binary representation (bits). |
| ADC (Analog to Digital Converter) | A device that converts an analog signal into a digital signal. |
| DAC (Digital to Analog Converter) | A device that converts a digital signal into an analog signal. |
| Distortion | An alteration of the original signal's shape or characteristics during transmission, which can be caused by various factors in the communication channel. |
| Noise | Unwanted disturbances or signals that interfere with the intended signal during transmission, degrading its quality. |
| Attenuation | The loss of signal strength over distance as it travels through a transmission medium. |
| Multipath Propagation (Fading) | A phenomenon where a transmitted signal reaches the receiver via multiple paths, causing constructive or destructive interference and signal strength fluctuations. |
| Baseband Transmission | A method of transmitting digital data directly as a sequence of pulses without using a carrier signal. |
| Carrier Transmission | A method of transmitting digital data by modulating a high-frequency carrier signal with the digital information. |
| Modulation | The process of varying one or more properties (amplitude, phase, or frequency) of a carrier wave in accordance with the information to be transmitted. |
| Amplitude Shift Keying (ASK) | A modulation technique where the amplitude of a carrier signal is varied to represent digital data. On-Off Keying (OOK) is a form of ASK. |
| Phase Shift Keying (PSK) | A modulation technique where the phase of a carrier signal is varied to represent digital data. |
| Binary Phase Shift Keying (BPSK) | A type of PSK that uses two distinct phases of the carrier signal to represent binary data (0 and 1). |
| Pulse Amplitude Modulation (PAM) | A technique where the amplitude of a pulse is varied to represent data. Binary PAM uses two amplitude levels. |
| M-PAM | A form of Pulse Amplitude Modulation that uses M distinct amplitude levels to represent $k = \log_2(M)$ bits of data per symbol. |
| Twisted Pair Cable | A type of cable consisting of two insulated copper wires twisted around each other to reduce electromagnetic interference. |
| Coaxial Cable | A type of electrical cable with an inner conductor surrounded by an insulating layer, a braided metal shield, and an outer insulating layer. |
| Optical Fiber | A thin strand of glass or plastic that transmits data using light signals. |
| Radio | Electromagnetic waves used for wireless communication. |
| Manchester Coding | A line code that encodes clock and data into transitions in the signal. A transition occurs in the middle of each bit period, and a zero crossing at the start of the bit period indicates the data bit. |
| Differential Manchester Coding | A line code that uses a transition at the beginning of each bit period to indicate the data. The absence or presence of an additional transition indicates the data bit value. |
Cover
eitf45 -L3- data link layer MAC.pdf
Summary
# Data link layer and local area networks
The data link layer and local area networks focus on how devices within a limited geographical area communicate, particularly through shared media and various network topologies [3](#page=3) [5](#page=5).
## 1. Data link layer and local area networks
### 1.1 Introduction to local area networks (LANs)
Local Area Networks (LANs) are networks that are limited in size and traditionally designed for private areas. Historically, LANs were characterized by a "shared-medium" concept, where multiple devices connected to the same communication channel. This meant that all devices on the network could potentially see all traffic [5](#page=5) [6](#page=6) [8](#page=8).
### 1.2 LAN topologies
Various network topologies have been used for LANs to structure how devices are interconnected. These include [7](#page=7):
* **Mesh topology**: In a mesh topology, every device is connected to every other device on the network. This provides high redundancy but can be complex and expensive to implement [7](#page=7).
* **Bus topology**: In a bus topology, all devices are connected to a single central cable, known as the bus. Data is sent along the bus, and all devices receive the data, but only the intended recipient processes it [7](#page=7).
* **Ring topology**: In a ring topology, devices are connected in a circular fashion. Data travels in one direction around the ring, passing through each device until it reaches its destination [7](#page=7).
* **Star topology**: In a star topology, all devices are connected to a central hub or switch. This is a common topology in modern LANs, offering easier management and fault isolation [7](#page=7).
### 1.3 Data transfer on a shared medium
On a shared medium, data is typically broadcast to all devices connected to the medium. A packet is sent from a source device, and all other devices receive it. The network interface card (NIC) of each device then checks the destination address in the packet to determine if it should process the data or discard it. To manage this shared access effectively and prevent collisions (when multiple devices try to transmit simultaneously), specific access methods and protocols are required [3](#page=3) [8](#page=8).
### 1.4 IEEE's LAN standards (Project 802)
The Institute of Electrical and Electronics Engineers (IEEE) has established standards for LANs under Project 802. These standards define various aspects of LAN technologies, including different media access control methods and physical layer specifications. Notable standards include [9](#page=9):
* **IEEE 802.3**: This standard primarily defines Ethernet, which is one of the most widely used LAN technologies [9](#page=9).
* **IEEE 802.4**: This standard relates to Token Bus networks [9](#page=9).
* **IEEE 802.5**: This standard defines Token Ring networks [9](#page=9).
These standards aim to ensure interoperability between different network devices and vendors [9](#page=9).
> **Tip:** Understanding the evolution from shared-medium LANs to switched networks is crucial. While older topologies like bus and ring are less common today, the principles of shared access and medium contention remain relevant, especially in wireless contexts.
> **Example:** Imagine a simple bus topology where Device A wants to send data to Device C. Device A broadcasts the packet. Device B receives it, checks the destination (C), and discards it. Device C receives it, checks the destination (C), and accepts it. Device D receives it, checks the destination (C), and discards it [8](#page=8).
---
# Ethernet and medium access control methods
This section delves into the foundational aspects of standard Ethernet, tracing its evolution from shared collision domains to modern switched networks, while also detailing the structure of an Ethernet frame and the principles of Carrier Sense Multiple Access with Collision Detection (CSMA/CD) [10](#page=10) [11](#page=11) [12](#page=12) [13](#page=13) [14](#page=14) [15](#page=15) [16](#page=16) [17](#page=17) [29](#page=29) [30](#page=30) [31](#page=31) [32](#page=32).
### 2.1 Evolution of Ethernet and collision domains
Ethernet has evolved significantly, particularly concerning how network devices share the transmission medium. In early Ethernet implementations, a single coaxial cable often formed a shared collision domain. A collision domain is a network segment where data packets originating from multiple devices can collide with each other, corrupting the data [12](#page=12).
#### 2.1.1 Hubs and repeaters
Hubs and repeaters act as multi-port repeaters, extending the physical length of a network segment and, importantly, also extending collision domains. All devices connected to a hub are part of the same collision domain [12](#page=12).
#### 2.1.2 Switched Ethernet
The advent of switches revolutionized Ethernet by segmenting collision domains. A network switch intelligently forwards data packets only to the intended destination port, based on MAC addresses. This drastically reduces the occurrence of collisions [13](#page=13).
#### 2.1.3 Full-duplex switched Ethernet
Modern switched Ethernet often operates in full-duplex mode. In full-duplex, a device can send and receive data simultaneously without the possibility of collisions on that link. This is because each port on the switch can have its own dedicated collision domain, effectively making each link a separate domain [14](#page=14).
### 2.2 Ethernet frame structure
An Ethernet frame is the basic unit of data transmission on an Ethernet network. While the specific content and length can vary, a typical Ethernet frame consists of several fields, including [16](#page=16):
* **Preamble:** A sequence of bits used for synchronization [16](#page=16).
* **Start Frame Delimiter (SFD):** Marks the end of the preamble and the beginning of the frame's actual data [16](#page=16).
* **Destination MAC Address:** The physical hardware address of the intended recipient [16](#page=16).
* **Source MAC Address:** The physical hardware address of the sender [16](#page=16).
* **Type/Length:** Indicates the protocol of the payload or the length of the frame [16](#page=16).
* **Payload:** The actual data being transmitted [16](#page=16).
* **Frame Check Sequence (FCS):** A checksum used for error detection [16](#page=16).
> **Tip:** The MAC address is a unique 48-bit hardware address assigned to network interface controllers (NICs). You can view your system's MAC address using commands like `ipconfig /all` on Windows or `ifconfig` on Linux/macOS [15](#page=15).
> **Example:** The hexadecimal view on page 17 shows a sample Ethernet frame, illustrating the arrangement of these fields [17](#page=17).
### 2.3 Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
CSMA/CD is a media access control (MAC) protocol used in early Ethernet networks to manage shared access to a common transmission medium. It was developed to handle situations where multiple devices might attempt to transmit data simultaneously, leading to collisions [29](#page=29).
#### 2.3.1 Carrier Sense
The "Carrier Sense" part means that a transmitting device first listens to the transmission medium to detect if it is currently busy. If the medium is idle, the device proceeds to transmit. If it is busy, the device waits [29](#page=29).
#### 2.3.2 Multiple Access
"Multiple Access" signifies that multiple devices share the same transmission medium, all capable of sending and receiving data [29](#page=29).
#### 2.3.3 Collision Detection (CD)
"Collision Detection" is the crucial component that differentiates CSMA/CD from basic CSMA. While transmitting, a device continues to monitor the medium. If it detects that its transmission is interfering with another transmission (i.e., a collision has occurred), it immediately aborts its transmission [29](#page=29) [30](#page=30).
* **Collision Procedure:** Upon detecting a collision, the device stops transmitting its current frame and sends a jamming signal to ensure that all other stations on the network are aware of the collision. After sending the jamming signal, the device waits for a random amount of time (using a binary exponential backoff algorithm) before attempting to retransmit the frame [30](#page=30).
> **Tip:** The purpose of the jamming signal is to ensure that all stations detect the collision and stop transmitting, preventing further corruption [30](#page=30).
#### 2.3.4 Minimum frame size
A critical aspect of CSMA/CD is the minimum frame size requirement. The sending station must be able to detect a collision *before* it finishes transmitting the last bit of the frame. This ensures that a device doesn't complete a corrupted transmission without realizing it [31](#page=31).
The minimum frame size is determined by the round-trip propagation delay of the network segment. The formula for the minimum frame size is related to the propagation speed and the maximum segment length.
Let $T_{prop}$ be the propagation delay and $R$ be the bit rate.
The minimum time a station must be able to detect a collision is $2 \times T_{prop}$ [31](#page=31).
The minimum frame size $L_{min}$ in bits is given by:
$$ L_{min} = R \times (2 \times T_{prop}) $$
Where $T_{prop}$ is the time it takes for a signal to travel from one end of the network segment to the other and back. For a segment of length $D$ with propagation speed $v_{prop}$, $T_{prop} = D / v_{prop}$ [31](#page=31).
> **Example:** Consider a 10 Mbps link that is 5 km long, with a propagation speed of 2/3 of the speed of light ($v_{prop} = \frac{2}{3} \times 300,000 \text{ km/s} = 200,000 \text{ km/s} = 2 \times 10^8 \text{ m/s}$) [32](#page=32).
>
> First, convert the length to meters: $D = 5 \text{ km} = 5000 \text{ m}$.
>
> Calculate the propagation delay:
> $$ T_{prop} = \frac{D}{v_{prop}} = \frac{5000 \text{ m}}{2 \times 10^8 \text{ m/s}} = 2.5 \times 10^{-5} \text{ s} $$
>
> The minimum time to detect a collision is $2 \times T_{prop}$:
> $$ 2 \times T_{prop} = 2 \times 2.5 \times 10^{-5} \text{ s} = 5 \times 10^{-5} \text{ s} $$
>
> The bit rate is $R = 10 \text{ Mbps} = 10 \times 10^6 \text{ bits/s}$.
>
> Calculate the minimum frame size:
> $$ L_{min} = R \times (2 \times T_{prop}) = (10 \times 10^6 \text{ bits/s}) \times (5 \times 10^{-5} \text{ s}) = 500 \text{ bits} $$
>
> Therefore, the minimum frame size that must be applied for the system to function end-to-end is 500 bits [32](#page=32).
---
# Random access methods for network communication
This topic explores fundamental random access methods used in network communication, focusing on ALOHA and the foundational principles of Carrier Sense Multiple Access (CSMA).
### 3.1 ALOHA
ALOHA is a multiple-access method that was pioneered by the ALOHANET, one of the first wireless local area networks developed by the University of Hawaii. It allows multiple stations to share a communication channel without prior coordination [19](#page=19).
#### 3.1.1 Pure ALOHA
In Pure ALOHA, stations can transmit a frame at any time they have data to send. If two or more stations transmit simultaneously, their frames collide, leading to data corruption [20](#page=20) [21](#page=21).
* **Collision Scenario:** A collision occurs if a frame is transmitted while another frame is already in transit or has not yet finished its transmission. The vulnerable period for a frame is twice the frame transmission time, as any transmission starting within that window will collide with the original frame [21](#page=21).
#### 3.1.2 Slotted ALOHA
Slotted ALOHA divides time into discrete slots of fixed duration, typically equal to the time required to transmit one frame. Stations are only allowed to transmit at the beginning of a slot [22](#page=22).
* **Collision Reduction:** By synchronizing transmissions to the start of slots, Slotted ALOHA reduces the probability of collisions compared to Pure ALOHA. A collision can only occur if multiple stations attempt to transmit at the beginning of the *same* slot. The vulnerable period is reduced to the duration of a single slot [23](#page=23) [24](#page=24).
#### 3.1.3 ALOHA resend strategy
When a collision is detected, stations employing ALOHA employ a resend strategy.
* **Backoff Time:** Stations wait for a random amount of time, known as the backoff time ($T_B$), before attempting to resend the frame [25](#page=25).
* **Binary Exponential Backoff:** A common backoff strategy is binary exponential backoff, where the backoff time is chosen from a range that doubles with each retransmission attempt. The backoff time is chosen uniformly from $[0, 2^k - 1 \times T_f$, where $k$ is the attempt number and $T_f$ is the frame transmission time [25](#page=25).
* **Maximum Attempts:** If a frame cannot be successfully transmitted after a maximum number of attempts ($K_{max}$), the station gives up and tries again later or aborts the transmission [25](#page=25).
#### 3.1.4 ALOHA throughput
The maximum theoretical throughput for Pure ALOHA is approximately 18% of the channel capacity, while Slotted ALOHA can achieve a theoretical maximum throughput of approximately 36% [26](#page=26).
> **Tip:** Understanding the throughput limitations of ALOHA highlights the need for more efficient access methods, especially in busy networks.
### 3.2 Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access (CSMA) is a method where stations first listen to (sense) the medium to determine if it is busy before transmitting [27](#page=27).
* **Basic CSMA Strategies:**
* **Persistent CSMA:** If the medium is busy, the station continues to sense the medium and transmits as soon as it becomes idle [27](#page=27).
* **Non-persistent CSMA:** If the medium is busy, the station waits for a random amount of time, senses the medium again, and transmits if it is idle [27](#page=27).
* **p-persistent CSMA:** If the medium is idle, the station transmits with probability $p$. With probability $1-p$, it waits for the next time slot and senses again. If the medium is busy, it waits and senses again [27](#page=27).
#### 3.2.1 CSMA vulnerable time
The vulnerable time in CSMA, during which collisions can still occur, is primarily influenced by the **propagation time** of the signal across the network. Even with carrier sensing, a station might begin transmitting just as another station has finished sensing and the medium has become busy, but before the signal from the transmitting station has reached it [28](#page=28).
---
# Wireless local area networks and collision avoidance
This section details wireless local area networks (WLANs), the challenges they face, and the mechanisms employed to manage them, primarily focusing on Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) and its related techniques [33](#page=33) [34](#page=34).
### 4.1 Introduction to wireless LANs
The popularity of the Internet and the increasing demand for mobility have driven the widespread adoption of wireless local area networks (WLANs). Unlike wired networks, wireless environments present unique challenges for data transmission and collision detection [33](#page=33) [34](#page=34).
### 4.2 The hidden terminal problem
A significant issue in wireless networks is the "hidden terminal problem". This problem arises when two nodes can communicate with a central access point (AP), but cannot directly communicate with each other due to distance or obstructions. In such scenarios, a node might transmit data, unaware that another node is also transmitting, leading to a collision at the AP that neither of the transmitting nodes can detect. This makes collision detection mechanisms like Carrier Sense Multiple Access with Collision Detection (CSMA/CD), commonly used in wired networks, ineffective in wireless environments [34](#page=34).
> **Tip:** The hidden terminal problem is a critical distinction between wired and wireless network design, necessitating different medium access control strategies.
### 4.3 Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA)
To address the limitations of collision detection in wireless networks and mitigate issues like the hidden terminal problem, Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) was developed. CSMA/CA is a protocol that aims to avoid collisions by implementing several mechanisms [35](#page=35):
1. **Interframe Space (IFS):** Before transmitting, a station waits for a specific period of time known as an Interframe Space (IFS). Different IFS durations are used to prioritize traffic and manage access [35](#page=35).
2. **Contention Window (CW):** If the medium is sensed idle after the IFS, the station draws a random backoff time from a contention window (CW). The size of the CW determines the range of random backoff times. A smaller CW leads to more frequent transmissions and potentially more contention, while a larger CW reduces contention but increases waiting times [35](#page=35).
3. **Request to Send/Clear to Send (RTS/CTS):** This is a specific mechanism designed to solve the hidden terminal problem [35](#page=35) [36](#page=36).
#### 4.3.1 RTS/CTS mechanism
The Request to Send/Clear to Send (RTS/CTS) mechanism provides a more robust way to manage access and prevent collisions, particularly in the presence of hidden terminals. The process works as follows [36](#page=36):
* A station intending to transmit first sends a small RTS (Request to Send) frame to the intended recipient (e.g., the access point) [36](#page=36).
* Upon receiving the RTS, if the recipient is ready to receive, it sends back a CTS (Clear to Send) frame [36](#page=36).
* Both the RTS and CTS frames contain information about the duration of the upcoming data transmission.
* Any other station that overhears either the RTS or CTS frame will defer its transmission for the duration specified in these frames, effectively preventing it from transmitting and causing a collision while the actual data transfer is in progress. This ensures that stations that might be hidden from each other but can hear the AP (which can hear both) are informed about the ongoing transmission [36](#page=36).
> **Example:** Consider three nodes: Node A, Node B, and an Access Point (AP). Node A can communicate with the AP, and Node B can communicate with the AP, but Node A and Node B cannot directly communicate with each other (hidden terminal problem).
> 1. Node A wants to send data to the AP.
> 2. Node A sends an RTS to the AP.
> 3. Node B is within hearing range of the AP and overhears the RTS. Node B knows a transmission is about to occur and defers its own transmission.
> 4. The AP receives the RTS and sends a CTS back to Node A.
> 5. Node B is also within hearing range of the AP and overhears the CTS. Node B continues to defer its transmission.
> 6. Node A receives the CTS and proceeds to send its data frame to the AP.
> 7. Both Node A and Node B have avoided a collision at the AP.
#### 4.3.2 CSMA/CA control logic
The overall control logic for CSMA/CA involves sensing the medium, waiting for the appropriate IFS, performing a random backoff if necessary, and potentially using RTS/CTS for explicit channel reservation. If a transmission is successful, the station enters a listening state. If a collision is detected (or inferred through timeouts), the CW size may be increased, and the backoff process is repeated [37](#page=37).
### 4.4 IEEE 802.11 standard
The IEEE 802.11 project is the standard that defines wireless local area networking (WLAN). This standard incorporates CSMA/CA and its associated mechanisms to ensure reliable data communication in unlicensed radio frequency bands. The standard has evolved over time with various amendments (e.g., 802.11a, 802.11b, 802.11g, 802.11n, 802.11ac) to improve data rates, range, and efficiency [35](#page=35) [38](#page=38).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Data Link Layer | The second layer of the OSI model, responsible for reliable data transfer between nodes on a network segment. It handles physical addressing, framing, and error detection. |
| Local Area Network (LAN) | A computer network that interconnects computers within a limited area such as a residence, school, laboratory, university campus or office building. |
| Shared Medium | A network medium that is used by multiple devices simultaneously, requiring mechanisms to manage access and prevent collisions. |
| Network Topology | The arrangement of the elements (links, nodes, etc.) of a communication network. Common topologies include bus, ring, star, and mesh. |
| Ethernet | A family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). |
| Medium Access Control (MAC) | A sublayer of the Data Link Layer that controls how network devices gain access to a shared transmission medium and transmits data. |
| CSMA/CD (Carrier Sense Multiple Access with Collision Detection) | A network protocol that listens to the communication channel before transmitting and detects if a collision has occurred after transmission, aborting if necessary. |
| ALOHA | A random-access method for sharing a broadcast channel, allowing multiple users to transmit data packets at any time. It is known for its simplicity but can lead to collisions. |
| Pure ALOHA | A variant of ALOHA where stations can transmit frames at any time, leading to a higher probability of collisions. |
| Slotted ALOHA | An improvement over Pure ALOHA where time is divided into discrete slots, and stations can only transmit at the beginning of a slot, reducing collision probability. |
| Throughput | The rate at which data is successfully transferred over a network connection, often expressed as bits per second. |
| Backoff Time | A random waiting period implemented by network protocols after a collision before retransmitting data, to reduce the likelihood of repeated collisions. |
| CSMA (Carrier Sense Multiple Access) | A protocol that determines when to transmit a data packet on a network medium by first sensing whether the medium is in use. |
| Collision Detection | The process of identifying when two or more devices transmit data simultaneously on a shared network medium, causing data corruption. |
| CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) | A protocol used in wireless networks that attempts to avoid collisions before they happen, often by using mechanisms like acknowledgments and contention windows. |
| Hidden Terminal Problem | A situation in wireless networking where two nodes can communicate with an access point but not with each other, making collision detection difficult. |
| RTS/CTS (Request to Send/Clear to Send) | A mechanism used in wireless networks to mitigate the hidden terminal problem by allowing nodes to reserve the medium before transmitting data. |
| IEEE 802.11 | A set of media access control and error-checking protocols for digital network communications commonly employed in wireless local area networks (WLANs). |
| Ethernet Frame | A data packet format used in Ethernet networks, typically containing source and destination MAC addresses, type/length information, payload data, and a frame check sequence. |
| MAC Address | A unique identifier assigned to network interfaces for communications at the data link layer of a network segment. |
Cover
eitf45 -L4- data link layer control functions.pdf
Summary
# Framing and bit stuffing in data link layer
Framing and bit stuffing in data link layer organizes the physical layer's bitstream into frames and ensures data integrity by preventing premature flag detection.
## 1. Framing in the data link layer
### 1.1 Purpose of framing
The physical layer delivers a raw bitstream, which is a continuous sequence of bits. The data link layer's responsibility is to organize this bitstream into discrete units called frames. This framing process is crucial for managing data transmission, error detection, and flow control [4](#page=4).
### 1.2 Why frames?
Frames allow the data link layer to implement mechanisms like sequence numbers (SEQ) and acknowledgments (ACK) for reliable data transfer. They also facilitate error detection using Cyclic Redundancy Check (CRC). Without framing, it would be difficult to delineate individual data units and manage their transmission effectively [4](#page=4).
## 2. Bit stuffing
### 2.1 The need for bit stuffing
Bit stuffing is a technique used to ensure that the data within a frame does not accidentally mimic the frame delimiter (flag). A common flag sequence used to mark the beginning and end of a frame is `01111110`. The problem arises if the actual data payload contains a sequence of six or more consecutive '1's, as this could be misinterpreted by the receiver as the end-of-frame flag, leading to premature frame termination [5](#page=5).
> **Tip:** Bit stuffing is a mechanism to guarantee that the flag sequence does not appear within the payload of a frame, thus maintaining the integrity of frame boundaries.
### 2.2 Bit stuffing mechanism
To prevent the flag sequence from appearing in the payload, a bit stuffing procedure is employed:
* **Sender's action:** When the sender detects five consecutive '1's in the payload, it automatically inserts an extra '0' bit immediately after the fifth '1'. This breaks the sequence of six or more '1's [5](#page=5).
* **Receiver's action:** Upon receiving the data, the receiver performs de-stuffing. If it encounters a '0' bit immediately following five consecutive '1's, it removes that '0' bit. This restores the original data stream [5](#page=5).
#### 2.2.1 Example of bit stuffing
Consider the flag sequence `01111110`. If the payload data contains a sequence like `01111111110` the sender would stuff a '0' after the fifth consecutive '1' [5](#page=5):
Original payload: `01111111110`
Stuffing at the first five 1's: `011111`**`0`**`111110`
Stuffing at the second five 1's: `011111011111`**`0`**`0`
The framed data would then look something like: `01111110` **`01111101111100`** `01111110` [5](#page=5).
The receiver, upon seeing `0111110` followed by a '0', will remove the '0' to get `0111111`. Similarly, when it sees `111110` followed by a '0', it will remove the '0' to get `111111`. This ensures that only the actual frame delimiters are recognized as such [5](#page=5).
---
# Error detection mechanisms
This section details various techniques used to detect errors in transmitted data, ensuring data integrity over communication channels [10](#page=10).
### 2.1 The role of error detection
Error detection mechanisms are fundamental components of link layer protocols. Their primary goal is to ensure that data is assumed to be error-free by higher network layers. Errors, which can manifest as bit errors or burst errors typically occur at the physical layer and are the responsibility of the data link layer to handle. The process involves adding extra bits, through an encoding scheme, to the original data before transmission. The receiver then uses these extra bits to check for errors [6](#page=6) [7](#page=7) [8](#page=8) [9](#page=9).
### 2.2 Error detection schemes
Several methods are employed for error detection, each with varying levels of complexity and effectiveness. The common schemes include the simple parity-check code, checksum, and the Cyclic Redundancy Check (CRC) [10](#page=10).
#### 2.2.1 Simple parity-check code
The simple parity-check code involves adding an extra bit, known as a parity bit, to the dataword. This bit is chosen to make the total number of '1's in the resulting codeword either even (even parity) or odd (odd parity) [11](#page=11).
* **Even Parity:** The parity bit is set to '1' if the number of '1's in the dataword is odd, and '0' if the number of '1's is even, ensuring an even total count of '1's in the codeword.
* **Odd Parity:** The parity bit is set to '1' if the number of '1's in the dataword is even, and '0' if the number of '1's is odd, ensuring an odd total count of '1's in the codeword.
A significant limitation of this method is that it can only detect an odd number of errors. If an even number of bit errors occur, the parity remains unchanged, and the error goes undetected [11](#page=11).
> **Tip:** While simple to implement, the parity-check code is not very robust. It's useful for detecting single-bit errors but fails for common scenarios like burst errors or even numbers of bit flips.
#### 2.2.2 Checksum
The checksum is another error detection technique used by several Internet protocols. The concept involves treating the data to be transmitted as a sequence of numbers. These numbers are then added together to produce a checksum value, which is appended to the data. The receiver performs the same addition on the received data. If the calculated checksum matches the received checksum, the data is considered error-free [14](#page=14).
> **Example:** If a bit sequence is to be protected with a 4-bit checksum, it is typically divided into segments. These segments are then treated as binary numbers and summed up. The checksum is derived from this sum, often by taking the one's complement of the sum.
#### 2.2.3 Cyclic Redundancy Check (CRC)
Cyclic Redundancy Check (CRC) is a more robust and widely used error detection mechanism. It relies on polynomial division for its operation [15](#page=15).
##### 2.2.3.1 Polynomial representation
In CRC, both the dataword and the generator are represented as polynomials.
* **Dataword (k bits):** Represented by a polynomial $d(x)$ of degree $k-1$ [16](#page=16).
* **Generator (m bits):** Represented by a polynomial $g(x)$ of degree $m-1$. This generator polynomial is predefined and shared between the sender and receiver [15](#page=15) [16](#page=16).
##### 2.2.3.2 The CRC principle
The objective of CRC is to find a remainder polynomial $r(x)$ such that when the data polynomial $d(x)$ is shifted left by $m-1$ positions (effectively multiplying by $x^{m-1}$) and the remainder $r(x)$ is added, the resulting codeword polynomial $c(x)$ is perfectly divisible by the generator polynomial $g(x)$ without any remainder [17](#page=17).
The formula is:
$$c(x) = d(x) \cdot x^{m-1} + r(x)$$
This implies that:
$$REM[c(x) / g(x)] = 0$$
The remainder polynomial $r(x)$ will have a degree of $m-2$ or less, meaning the CRC itself will consist of $m-1$ bits [17](#page=17).
> **Example:** For a dataword $1001$ (k=4), represented by $d(x) = x^3+1$, and a generator $1011$ (m=4), represented by $g(x) = x^3+x+1$. We want to find $r(x)$ such that $c(x) = d(x) \cdot x^3 + r(x)$ is divisible by $g(x)$.
>
> This involves polynomial long division.
> $d(x) \cdot x^3 = (x^3+1) \cdot x^3 = x^6 + x^3$.
>
> Performing the division of $x^6 + x^3$ by $x^3+x+1$:
> $x^6 + x^3$ divided by $x^3+x+1$ gives a quotient of $x^3+x$ and a remainder of $x+1$.
> So, $r(x) = x+1$.
>
> The codeword polynomial would be $c(x) = x^6 + x^3 + (x+1) = x^6+x^3+x+1$.
> The CRC bits (remainder) are $011$ (representing $x+1$, degree $1 < m-1=3$). The degree of $r(x)$ is $1$, which is $\leq m-2 = 2$.
> The final codeword would be $1001110$, where $1001$ is the data and $110$ are the CRC bits. Wait, the derivation in the document shows a different remainder. Let's re-evaluate the example based on the document's illustration [19](#page=19).
>
> Document illustration:
> Dataword: $1001$, $d(x) = x^3+1$. Generator: $1011$, $g(x) = x^3+x+1$.
> $d(x) \cdot x^{m-1} = (x^3+1) \cdot x^3 = x^6 + x^3$.
>
> The polynomial division depicted in shows [19](#page=19):
> $1001000$ (which is $d(x) \cdot x^3$)
> XOR with $1011$ (this is the first step of division, equivalent to subtracting $g(x)$ shifted)
> Resulting in $0010$
> Bring down the next bit ($0$) to get $00100$
> XOR with $0000$ (as the leading bit is $0$)
> Resulting in $0100$
> Bring down the next bit ($0$) to get $01000$
> XOR with $1011$ (this is where $g(x)$ is subtracted)
> Resulting in $1110$
> Bring down the last bit ($0$) to get $11100$ (error in transcription, should be $1111$ from the previous step)
> The document illustration for $d(x) \cdot x^3$ has an extra bit. The calculation for $d(x) \cdot x^{m-1}$ is for a $k$-bit dataword and an $m$-bit generator to produce an $(k+m-1)$-bit codeword. So for $k=4$ and $m=4$, we consider $d(x) \cdot x^{4-1} = d(x) \cdot x^3$.
>
> $d(x) = x^3+1$
> $d(x) \cdot x^3 = (x^3+1)x^3 = x^6 + x^3$
>
> Polynomial division of $x^6 + x^3$ by $x^3+x+1$ (using binary arithmetic, XOR operation):
> $1001000$ ($x^6+x^3$)
> $1011$ ($g(x)$ aligned)
> ----- (XOR)
> $0010000$ (bring down next 0)
> $0000$ ($g(x)$ aligned, multiplied by $0$)
> ----- (XOR)
> $010000$ (bring down next 0)
> $1011$ ($g(x)$ aligned, multiplied by $1$, $x \cdot g(x) = x^4+x^2+x$)
> ----- (XOR)
> $110100$ (this calculation seems to be deviating from standard polynomial division, let's stick to the document's visual representation)
>
> Based on the provided diagram the polynomial division of $1001000$ by $1011$ yields a remainder $r(x)$ represented by $110$ [19](#page=19).
>
> Thus, $r(x) = x^2 + x$.
> The codeword $c(x)$ is $d(x) \cdot x^3 + r(x) = (x^3+1)x^3 + (x^2+x) = x^6+x^3+x^2+x$.
> This corresponds to the bit string $1001110$.
> The remainder $110$ has $m-1=3$ bits [17](#page=17).
##### 2.2.3.3 Standard CRC polynomials
Various standard CRC polynomials are defined and used in different communication protocols and standards, such as CRC-8, CRC-16, CRC-32, etc. These polynomials are chosen for their error-detecting capabilities. Some common CRC polynomials are listed in [22](#page=22).
> **Tip:** Understanding the polynomial representation and the division process is key to mastering CRC. It's important to remember that the generator polynomial $g(x)$ must have its highest and lowest order bits set to 1 [22](#page=22).
### 2.3 Error detection in practice
The choice of error detection mechanism depends on factors like the expected error rate, the required level of reliability, and the computational resources available. CRC is generally preferred for its superior error detection capabilities compared to parity checks or simple checksums [11](#page=11) [14](#page=14) [15](#page=15).
---
# Error correction and flow control strategies
This topic explores mechanisms for handling detected errors and managing data transmission rates to prevent receiver overload [23](#page=23) [41](#page=41).
### 3.1 Error correction strategies
When errors are detected in transmitted data, two primary strategies exist for correction: Forward Error Correction (FEC) and retransmission [23](#page=23).
#### 3.1.1 Forward error correction (FEC)
FEC involves sending each bit multiple times and employing a majority decision at the receiver to decode the correct value. This method allows the receiver to correct errors without requiring retransmission from the sender [23](#page=23).
#### 3.1.2 Retransmission
The alternative to FEC is retransmission, where the entire frame containing the detected error is resent. This approach relies on the receiver acknowledging correctly received frames [23](#page=23) [24](#page=24).
### 3.2 Flow control mechanisms
Flow control ensures that a sender does not overwhelm a receiver with data. Key protocols for flow control, often implemented within Automatic Repeat Request (ARQ) schemes, include Stop-and-Wait, Go-back-N, and Selective Repeat [25](#page=25) [30](#page=30) [41](#page=41).
#### 3.2.1 Stop-and-wait ARQ
In the Stop-and-Wait ARQ protocol, the sender transmits a frame and then stops, waiting for an acknowledgment (ACK) from the receiver before sending the next frame. A timer is maintained for the waiting period, and if the ACK is not received within this time, the frame is retransmitted. Sequence numbers are used for frames, and acknowledgments typically indicate the expected next sequence number [26](#page=26).
**Normal operation:** The sender sends a frame, waits for an ACK, and then proceeds to the next frame [27](#page=27).
**Potential issues:**
* **Frame loss:** If a transmitted frame is lost, the sender will time out waiting for an ACK and will retransmit the frame [28](#page=28).
* **ACK loss:** If the ACK for a correctly received frame is lost, the sender will time out and retransmit the frame, even though the receiver already has it. This can lead to duplicate frames at the receiver [29](#page=29).
**Inefficiency:** A significant drawback of Stop-and-Wait is its inefficiency due to frequent waiting periods, which do not keep the communication "pipe" full [30](#page=30).
#### 3.2.2 Sliding window protocols
To address the inefficiency of Stop-and-Wait, sliding window protocols were developed. These protocols aim to keep the communication channel busy by allowing the sender to transmit multiple frames before requiring an acknowledgment. The "window" represents the set of frames that can be sent, and its size is crucial [30](#page=30) [31](#page=31).
##### 3.2.2.1 Go-back-N ARQ
Go-back-N ARQ is an improvement that allows the sender to transmit up to 'N' frames without waiting for individual ACKs. The receiver acknowledges frames sequentially. If a frame is lost, the sender will time out or receive a negative acknowledgment, and then it must retransmit the lost frame and all subsequent frames that were sent after it [32](#page=32) [33](#page=33).
**Normal operation:** The sender transmits frames sequentially, and the receiver acknowledges them [32](#page=32).
**Frames lost:** If frame 'k' is lost, the sender will eventually have to retransmit frame 'k' and all frames 'k+1', 'k+2', etc., that were sent [33](#page=33).
**Window size constraint:** For Go-back-N, the window size must be less than $2^m$, where $m$ is the number of bits used for sequence numbers. This constraint helps to avoid ambiguity between old and new frame numbers [37](#page=37).
##### 3.2.2.2 Selective repeat ARQ
Selective Repeat ARQ aims for higher efficiency by avoiding the retransmission of all subsequent frames when a single frame is lost. If a frame is lost, only that specific lost frame is retransmitted. This requires more complexity at the receiver, which needs to buffer out-of-order frames [34](#page=34).
**Efficiency:** Higher efficiency is achieved because unnecessary retransmissions are eliminated [34](#page=34).
**Complexity:** Requires higher receiver complexity to handle out-of-order frame buffering [34](#page=34).
**Window size constraint:** For Selective Repeat, the window size is typically $2^m - 1$, where $m$ is the number of bits for sequence numbers. This allows for unique identification of frames within the window [37](#page=37).
#### 3.2.3 Window size and RTT
The size of the sliding window is directly related to the Round-Trip Time (RTT) of the network. The goal is to allow the sender to transmit frames throughout the RTT period without depleting the window before the first ACK is expected. A larger window size can be used when the RTT is longer, assuming it does not violate the constraints for Go-back-N or Selective Repeat protocols [40](#page=40).
> **Tip:** Understanding the relationship between window size, RTT, and the number of bits for sequence numbers ($m$) is crucial for designing efficient and reliable data link protocols.
> **Example:** If using 3 bits for sequence numbers ($m=3$), the sequence numbers range from 0 to 7. For Go-back-N, the maximum window size is less than $2^3 = 8$, so it could be 7. For Selective Repeat, the maximum window size is $2^3 - 1 = 7$.
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Framing | The process by which the link layer organizes the physical layer's bitstream into discrete units called frames, enabling structured data transmission. |
| Bit stuffing | A technique used in data link layer protocols to prevent the occurrence of flag sequences within the data payload by inserting or deleting specific bits, typically a '0' after five consecutive '1's. |
| Error detection | A mechanism employed by the data link layer to identify the presence of errors introduced during data transmission, ensuring that the receiver is aware of corrupted data. |
| Error correction | A mechanism that not only detects but also corrects errors in transmitted data, allowing the receiver to reconstruct the original, uncorrupted data without retransmission. |
| Flow control | A mechanism that manages the rate of data transmission between two nodes to prevent a fast sender from overwhelming a slow receiver, ensuring efficient and reliable communication. |
| Parity-check code | A simple error detection scheme that adds an extra bit (parity bit) to a dataword to make the total number of '1's either even (even parity) or odd (odd parity), capable of detecting an odd number of bit errors. |
| Checksum | An error detection technique that involves summing up blocks of data and transmitting the sum along with the data; the receiver recalculates the sum and compares it to detect errors. |
| Cyclic Redundancy Check (CRC) | A sophisticated error detection algorithm that uses polynomial division to generate a checksum, providing a high probability of detecting burst errors and other common transmission faults. |
| Polynomial representation | A method of representing bit sequences and generator polynomials in error detection schemes like CRC, where bits correspond to coefficients of a polynomial, facilitating mathematical operations. |
| Dataword | The original sequence of bits representing the data to be transmitted. |
| Generator polynomial | A predefined polynomial used in CRC calculations to generate the remainder, which is appended to the dataword to form the codeword. |
| Codeword | The data transmitted after error detection/correction bits have been added to the original dataword. |
| Forward Error Correction (FEC) | An error correction technique where redundant data is added to the original data in such a way that the receiver can detect and correct a certain number of errors without requiring retransmission. |
| Retransmission | The process of resending an entire frame or data block that has been detected as erroneous or lost during transmission. |
| Stop-and-wait ARQ | An Automatic Repeat reQuest protocol where the sender transmits a frame and then waits for an acknowledgment (ACK) from the receiver before sending the next frame, with a timeout mechanism for retransmission. |
| Automatic Repeat Request (ARQ) | A family of error control protocols that use acknowledgments and timeouts to detect and recover from transmission errors. |
| Go-back-N ARQ | An ARQ protocol where the sender can transmit multiple frames before waiting for an ACK. If an error is detected, the sender retransmits the erroneous frame and all subsequent frames. |
| Selective repeat ARQ | An ARQ protocol that is more efficient than Go-back-N, as it only retransmits the specific frames that were detected as erroneous or lost, and the receiver buffers out-of-order frames. |
| Sliding window | A flow control mechanism that allows the sender to transmit multiple frames within a defined window size without waiting for individual ACKs, improving efficiency over stop-and-wait. |
| Round-trip time (RTT) | The total time taken for a signal or data packet to travel from a sender to a receiver and back to the sender. |
Cover
eitf45 -L5- network layer IP and routing.pdf
Summary
# The internet and network layer architecture
This section summarizes the fundamental architecture of the internet and the core functions of the network layer, focusing on routing and forwarding.
### 1.1 Internet architecture
The internet is a global network of interconnected computer networks. It is comprised of two main types of networks: access networks, which connect end-users to the internet, and backbone networks, which form the high-speed core of the internet. A crucial element that unites all networks within the internet is the Internet Protocol (IP) [12](#page=12) [4](#page=4).
### 1.2 Network layer protocols
The network layer, often referred to as Layer 3 (L3), is responsible for end-to-end communication between hosts. This is distinct from the data link layer (L2), which operates on a hop-by-hop basis. Routers are the primary devices operating at the network layer and perform two key functions: routing and forwarding [24](#page=24) [6](#page=6) [9](#page=9).
#### 1.2.1 Routers and their functions
Routers are internetworking devices that connect different networks. They handle the process of directing data packets across these networks [24](#page=24) [9](#page=9).
##### 1.2.1.1 Routing
Routing is the process of selecting the optimal path for data packets to travel from their source to their destination. This involves using a cost metric to evaluate different paths and sharing information about network topology. Routing algorithms define the rules and procedures for how this information is exchanged and how paths are determined. Routing can be managed in a central or distributed manner [10](#page=10) [24](#page=24) [9](#page=9).
##### 1.2.1.2 Forwarding
Forwarding, in contrast to routing, is the actual act of moving a packet from an incoming link to an outgoing link on a router. This is a much faster, per-packet operation. One important aspect of forwarding is address aggregation, which helps in efficient routing [11](#page=11) [24](#page=24) [25](#page=25) [9](#page=9).
### 1.3 Internet Protocol (IP)
The Internet Protocol (IP) is the foundational protocol of the internet. It defines how data is addressed and formatted into packets for transmission across the network. IP handles network addresses and is essential for enabling host-to-host delivery, even when multiple applications are running on the same host. The network layer protocol is responsible for ensuring that packets reach their intended destination across potentially diverse underlying network technologies [12](#page=12) [41](#page=41) [5](#page=5) [8](#page=8).
### 1.4 Summary of Network Layer [1](#page=1).
Key takeaways from this section include understanding the internet's architecture with its backbone and access networks, the role of routers in routing and forwarding, and the significance of the Internet Protocol (IP) for addressing and packet formats. The distinction between Layer 2 (hop-by-hop) and Layer 3 (end-to-end) is also crucial [41](#page=41) [6](#page=6).
> **Tip:** Remember that routing is the decision-making process of finding the best path, while forwarding is the action of sending the packet along that path. These are distinct but complementary functions of routers.
> **Tip:** The end-to-end principle is a key design philosophy of the internet, where complex functionalities are placed at the endpoints (hosts) rather than in the network core (routers) [41](#page=41).
> **Example:** Imagine sending a letter. Routing is like deciding which postal service and which route to use to get the letter to the destination city. Forwarding is like the mail carrier actually putting the letter into the correct truck or sorting bin to move it along that chosen route.
---
# Internet protocols and addressing
This section explores the Internet Protocol (IP) within networking models, focusing on IPv4 and IPv6 addressing, including classful and classless schemes, subnetting, and CIDR notation [41](#page=41).
### 2.1 The Internet Protocol (IP)
The Internet Protocol (IP) is a fundamental component of the TCP/IP model and operates at the network layer, comparable to Layer 3 of the OSI model. Its core functions include addressing, packet formatting, and managing internetworking [13](#page=13) [14](#page=14) [41](#page=41).
### 2.2 IPv4 addressing
IPv4 addresses are 32 bits long, equivalent to 4 bytes, providing a total of $2^{32}$ or 4,294,967,296 unique addresses. IPv4 addressing schemes have evolved from classful to classless addressing to manage the growing number of connected devices [17](#page=17) [19](#page=19).
#### 2.2.1 Classful addressing
In the early days of the internet, classful addressing was used, defining five address classes (A, B, C, D, and E). This system allowed addresses to be obtained only in predefined blocks, which proved insufficient as the internet grew [18](#page=18) [19](#page=19).
#### 2.2.2 Subnetting and supernetting
To address the limitations of classful addressing and the depletion of available addresses, subnetting and supernetting were introduced. Subnetting involves dividing larger address blocks (like Class A and B) into smaller subnets, while supernetting combines several smaller blocks (like Class C) into larger blocks [19](#page=19).
#### 2.2.3 Classless addressing (CIDR)
Classless addressing, also known as Classless Inter-Domain Routing (CIDR), emerged as a more flexible approach. In this scheme, IP addresses are allocated in blocks where the block size is a power of 2. A block is defined by its first address, which must be divisible by the block size ($N$), where $N = 2^{32-n}$, and '$n$' represents the number of bits in the network ID [21](#page=21).
> **Tip:** CIDR uses slash notation (e.g., /n) to represent the number of bits used for the network identifier, making it easier to denote the network and host portions of an address.
##### 2.2.3.1 CIDR notation and examples
CIDR notation is commonly represented as an IP address followed by a slash and the number of network bits, such as `205.16.37.39/28`. This notation replaces the need for fixed class boundaries [23](#page=23).
An example of IPv4 address decomposition using CIDR is as follows:
- **Address:** `11011110 00010111 01000011 01000100`
- **Mask:** `11111111 11111111 11000000 00000000`
- **Net-id:** `11011110 00010111 01000000 00000000`
- **Host-id:** `00000000 00000000 00000011 01000100`
In dotted-decimal notation, this translates to:
- **Address:** `222.23.67.68`
- **Mask:** `255.255.192.0`
- **Net-id:** `222.23.64.0`
- **Host-id:** `0.0.3.68`
With a CIDR notation of `/18` (indicating 18 network bits), the block size is $2^{32-18} = 2^{14} = 16,384$. The end of this block would be `222.23.127.255` [22](#page=22).
### 2.3 Problems with IPv4
Despite its widespread use, IPv4 faces significant challenges, including an insufficient address space, lack of inherent design for real-time applications, and no built-in support for encryption and authentication [28](#page=28).
### 2.4 IPv6 addressing
IPv6 was developed to overcome the limitations of IPv4, primarily addressing the critical issue of insufficient address space [29](#page=29).
#### 2.4.1 Advantages of IPv6
IPv6 offers several key advantages:
- **Larger address space:** IPv6 uses 128-bit addresses, providing a vastly expanded range of over $3 \times 10^{38}$ unique addresses ($2^{128}$) compared to IPv4's $4 \times 10^9$ addresses. This massive increase ensures long-term scalability [29](#page=29) [30](#page=30) [31](#page=31).
- **Improved header format:** The IPv6 base header has a constant length of 40 bytes, making packet processing more efficient. Optional fields can be added as needed, enhancing extensibility [29](#page=29).
- **Enhanced security:** IPv6 includes support for encryption and authentication options, addressing the security deficiencies of IPv4 [29](#page=29).
- **Support for real-time applications:** IPv6 provides mechanisms for special handling of datagrams, which can be requested to better support real-time applications [29](#page=29).
#### 2.4.2 IPv6 address structure and notation
IPv6 addresses are 128 bits long and are typically represented in hexadecimal notation, grouped into eight 16-bit blocks separated by colons. For example, a global unicast address is structured to identify individual computers uniquely and includes fields for type, area, ISP, and organization [30](#page=30) [32](#page=32).
> **Tip:** IPv6 addresses can be shortened by omitting leading zeros in each 16-bit block and by replacing consecutive blocks of zeros with a double colon (`::`), but this double colon can only be used once in an address.
---
# IPv4 and IPv6 packet structures and features
This topic delves into the intricate structures of IPv4 and IPv6 packets, comparing their header fields and exploring key features like fragmentation handling and the advanced capabilities of IPv6.
### 3.1 Internet Protocol (IP) packet structures
Internetworking relies on the Internet Protocol (IP) for addressing and defining packet formats, facilitating communication between diverse networks. IP operates at Layer 3 of the network model, encapsulating data from higher layers for transmission across networks [37](#page=37) [41](#page=41).
### 3.2 IPv4 packet structure
An IPv4 packet consists of a header followed by the data payload. The IPv4 header contains essential control information, including source and destination IP addresses, and fields that govern packet processing and routing [27](#page=27).
### 3.3 IPv6 packet structure and features
IPv6 introduces significant improvements over IPv4, notably a larger address space and a more efficient header format. The IPv6 base header is simpler, designed to be flexible and accommodate extensions through optional IPv6 extension headers [33](#page=33) [34](#page=34).
#### 3.3.1 IPv6 extension headers
Extension headers in IPv6 provide a mechanism for adding optional functionality without cluttering the base header. This design enhances flexibility and allows for the incorporation of advanced features [34](#page=34).
#### 3.3.2 Quality of Service (QoS) features in IPv6
IPv6 incorporates features to support Quality of Service (QoS) more effectively than IPv4. Two key fields for QoS are the Traffic Class and Flow Label [35](#page=35).
##### 3.3.2.1 Traffic Class field
The Traffic Class field is used for classifying packets, enabling different queueing schemes and influencing delay characteristics. This field is particularly relevant for differentiating between congestion-controlled protocols (like TCP) and non-congestion-controlled protocols (like UDP), as well as other protocols like RTP and RSVP [35](#page=35).
##### 3.3.2.2 Flow Label field
The Flow Label field is designed to identify a specific stream of packets, such as TCP sessions or virtual connections. Devices can use this label to look up forwarding or routing information in a flow label table, potentially reducing the need to run complex routing algorithms for every single packet within that flow [35](#page=35).
### 3.4 Fragmentation handling
Fragmentation is the process of dividing a large IP packet into smaller pieces when the packet size exceeds the Maximum Transmission Unit (MTU) of a network link [36](#page=36) [37](#page=37).
#### 3.4.1 IPv4 fragmentation
In IPv4, fragmentation can be performed by any router that encounters a packet too large for the next hop's MTU. The fragmented packet's header includes fields that help reassemble the original packet at the destination [36](#page=36) [38](#page=38).
#### 3.4.2 IPv6 fragmentation
IPv6 handles fragmentation differently: it is performed exclusively by the source node, not by intermediate routers. This design choice simplifies router processing. Defragmentation, however, is still the responsibility of the destination host [36](#page=36).
##### 3.4.2.1 Fragmentation offset in IPv6
The fragmentation offset is a crucial field within an IPv6 fragment header, indicating the relative position of the fragment within the reassembled original packet. The IPv6 header uses 13 bits for the fragmentation offset, which is less than the 16 bits in IPv4, implying a granularity of /8 bytes for offsets [39](#page=39).
> **Tip:** Understanding how fragmentation differs between IPv4 and IPv6 is vital for grasping the evolution of network efficiency and router workload. IPv6's approach offloads this task from routers to the end hosts.
> **Example:** Imagine a large video stream being sent over the internet. If the packet size exceeds the MTU of a particular link, IPv4 routers might break it down. In IPv6, if the source node initiates the transmission of a packet larger than the MTU, the source itself would create the necessary fragments before sending them out. The destination host would then receive these fragments and piece them back together using information like the fragmentation offset [36](#page=36) [39](#page=39).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Network Layer | The third layer in the OSI model and part of the Internet layer in the TCP/IP model, responsible for logical addressing and routing of data packets between networks. It operates on an end-to-end basis. |
| Router | An internetworking device that operates at the network layer. Its primary functions are routing (determining the best path for data packets) and forwarding (moving packets from an input interface to an output interface based on routing information). |
| Forwarding | The process by which a router moves a packet from an input link to an output link. This is typically done using a forwarding table that maps destination addresses to output links. |
| Routing | The process of selecting paths in a network along which to send network traffic. Routing algorithms determine the optimal path by using cost metrics and sharing information, often in a distributed manner. |
| IP (Internet Protocol) | A network layer protocol that provides logical addressing and packet routing across networks. It is the primary protocol of the Internet and is used in both IPv4 and IPv6 versions. |
| IPv4 | The fourth version of the Internet Protocol, using 32-bit addresses. It has been widely used but suffers from address exhaustion and limitations in supporting modern network features. |
| IPv6 | The sixth version of the Internet Protocol, designed to address the limitations of IPv4. It uses 128-bit addresses, offering a vastly larger address space, and includes improvements in header format, security, and Quality of Service (QoS). |
| Addressing Scheme | A system used to assign unique identifiers (addresses) to devices on a network, allowing for data packets to be sent to specific destinations. This includes defining the format, structure, and hierarchy of addresses. |
| Packet Formats | The defined structure of data units transmitted over a network. For the network layer, this refers to the IP packet structure, including header fields and the payload. |
| Classful Addressing | An older IPv4 addressing scheme that divided IP addresses into different classes (A, B, C, D, E) with predefined network and host portions. This system led to inefficient use of address space. |
| Classless Addressing (CIDR) | A method for allocating IP addresses and routing IP packets. CIDR eliminates the traditional classful divisions by using a prefix length (slash notation) to define the network portion of an address, allowing for more flexible and efficient allocation. |
| Subnetting | The process of dividing a larger IP network into smaller, more manageable subnetworks. This improves network organization, reduces traffic, and enhances security. |
| Supernetting | The opposite of subnetting, where multiple smaller network blocks are combined into a single, larger block. This is used for route aggregation to simplify routing tables. |
| Fragmentation | The process of dividing a large IP packet into smaller pieces (fragments) so that it can be transmitted over a network link with a smaller Maximum Transmission Unit (MTU). In IPv4, routers can perform fragmentation; in IPv6, only the source node does. |
| MTU (Maximum Transmission Unit) | The largest packet size, in bytes, that a data link layer protocol can pass on the network layer. If an IP packet exceeds the MTU of a link, it must be fragmented. |
| Flow Label | A field in the IPv6 header used to identify a stream of packets, such as those belonging to a single TCP session or virtual connection. This aids in consistent forwarding and potentially specialized handling by routers. |
| Traffic Class | A field in the IPv6 header that allows for the classification of packets. It can be used to prioritize different types of traffic, influencing queueing schemes and delay characteristics. |
Cover
eitf45 -L6- network layer ARP and networking tools.pdf
Summary
# Network configuration and addressing tools
This topic explores essential network tools that facilitate host configuration, IP address management, and name resolution [3](#page=3) [4](#page=4).
### 1.1 Configuration and addressing tools overview
Networking tools can be broadly categorized into those for configuration, addressing, and diagnostics. DHCP is a primary tool for configuration, while ARP and DNS are key for addressing and name resolution. NAT (Network Address Translation) is also mentioned as an addressing tool [3](#page=3) [4](#page=4).
A common scenario involves a host needing an IP address, DNS server information, and other network parameters, often leading to a cycle of requests involving DHCP [5](#page=5).
### 1.2 Dynamic Host Configuration Protocol (DHCP)
DHCP is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other network configuration parameters to devices. It simplifies network administration by automating the assignment of [6](#page=6):
* IP addresses [6](#page=6).
* Network masks [6](#page=6).
* Default gateways [6](#page=6).
* DNS server(s) [6](#page=6).
The DHCP operation involves a client requesting configuration, a server offering it, and the client accepting. Devices typically go through several states during DHCP, such as INIT, SELECTING, REQUESTING, BOUND, and RENEWING [7](#page=7) [8](#page=8).
### 1.3 Address Resolution Protocol (ARP)
ARP is a crucial protocol for mapping logical addresses (IP addresses) to physical hardware addresses (MAC addresses) within an IPv4 network. For IPv6, a similar function is performed by the Neighbor Discovery Protocol (NDP) [9](#page=9).
**Why ARP?**
ARP is necessary because the network layer (IP) operates with logical addresses, while the data link layer (Ethernet) requires physical MAC addresses for frame delivery. When a host needs to send a packet to another host on the same local network, it must know the destination's MAC address. If the source host does not have the destination's MAC address in its ARP cache, it must use ARP to discover it [10](#page=10).
**ARP Packet Structure:**
An ARP packet contains fields such as:
* Hardware Type: Specifies the network hardware (e.g., Ethernet) [11](#page=11).
* Protocol Type: Specifies the network protocol (e.g., IPv4) [11](#page=11).
* Hardware Address Length: The length of the MAC address [11](#page=11).
* Protocol Address Length: The length of the IP address [11](#page=11).
* Opcode: Indicates whether it's an ARP request or reply [11](#page=11) [1](#page=1) [2](#page=2).
* Sender Hardware Address (MAC address of sender) [11](#page=11).
* Sender Protocol Address (IP address of sender) [11](#page=11).
* Target Hardware Address (MAC address of target, if known) [11](#page=11).
* Target Protocol Address (IP address of target) [11](#page=11).
**ARP Request and Reply:**
An ARP request is broadcast to all devices on the local network, asking for the MAC address associated with a specific IP address. The host that owns the IP address responds with an ARP reply containing its MAC address, which is sent directly to the requesting host. This reply is unicast [12](#page=12).
**Examples:**
* **Local Communication:** If Host L1 wants to send data to Host L2 on the same network, and L1 doesn't know L2's MAC address, L1 broadcasts an ARP request for L2's IP address. L2 receives the request and replies with its MAC address [13](#page=13).
* **Remote Communication:** If Host 1 wants to send data to Host 4 (which is on a different network), Host 1 first sends the packet to its default gateway (e.g., Router R). Host 1 will use ARP to find the MAC address of R. Host 1 broadcasts an ARP request for Router R's IP address. Router R receives the request and replies with its MAC address [14](#page=14).
### 1.4 Domain Name System (DNS)
DNS is a hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It translates human-readable domain names (like `www.example.com`) into machine-readable IP addresses (like `192.168.1.1`). DNS is fundamental for accessing resources on the internet [15](#page=15).
**Domain Name Resolution:**
DNS resolution is the process of converting a domain name into an IP address. There are two primary methods:
* **Recursive Resolution:** In this method, a DNS resolver (usually on the client's machine or network) queries a DNS server, and the server is responsible for finding the IP address. If the server doesn't have the information cached, it will query other DNS servers on behalf of the client until it finds the answer. The client receives the final IP address from its resolver [16](#page=16).
* **Iterative Resolution:** In this method, the client (or its resolver) queries a series of DNS servers. Each server, if it doesn't have the answer, will return a referral to another DNS server that might have the information. The client must then query the referred server, continuing this process until it obtains the IP address [17](#page=17).
**Domain Name to IP Address Example:**
Resolving `magi.magicnet.se`:
1. The client asks its local DNS resolver (e.g., `ns.se` resolver) for the IP address of `magi.magicnet.se` [18](#page=18).
2. The `.se` top-level domain server (e.g., `ns.se`) doesn't know the IP for `magi.magicnet.se` but knows the authoritative server for `magicnet.se` is `ns.magicnet.se`. It returns a referral to `ns.magicnet.se` [18](#page=18) [19](#page=19).
3. The client's resolver then queries `ns.magicnet.se` for `magi.magicnet.se` [19](#page=19).
4. The `ns.magicnet.se` server also doesn't know the IP for `magi.magicnet.se` but knows the authoritative server for `magi` within `magicnet.se` is `ns.trollnet.se` (this step seems to deviate in the document's numbering, but indicates querying further down the hierarchy). *Correction based on typical DNS: it would ask for the IP of `magi.magicnet.se` directly, or refer to a server responsible for `magicnet.se` more generally.* A more typical path [19](#page=19):
* Query `ns.magicnet.se` for `magi.magicnet.se`.
* `ns.magicnet.se` provides the IP address for `magi.magicnet.se`.
5. The `ns.magicnet.se` server responds with the IP address for `magi.magicnet.se` (e.g., `194.52.54.47`) [20](#page=20).
6. This IP address is then returned to the original client [20](#page=20) [21](#page=21).
> **Tip:** Understanding the difference between recursive and iterative resolution is key to grasping how DNS queries traverse the internet hierarchy.
>
> **Tip:** ARP's efficiency relies on caching; expired cache entries can lead to redundant ARP requests.
---
# Network address translation and diagnostics
This section covers Network Address Translation (NAT) for managing IP address scarcity and the Internet Control Message Protocol (ICMP) for network diagnostics and error reporting [22](#page=22).
### 2.1 Network address translation (NAT)
The explosion in private internet usage led to a critical need for managing IP addresses, as the existing IPv4 space was insufficient. While IPv6 is the long-term solution, Network Address Translation (NAT) serves as an interim method to separate internal from external network addresses [22](#page=22).
#### 2.1.1 NAT implementation
NAT functions by modifying IP address and port number information in packet headers as they traverse a NAT router. This allows multiple devices on a private network to share a single public IP address [23](#page=23) [24](#page=24).
#### 2.1.2 NAT address translation process
When a device on a private network sends a packet to an external destination, the NAT router replaces the private source IP address with its own public IP address. Crucially, it also modifies the source port number to a unique global port number. This global port number acts as an identifier, allowing the NAT router to track which internal device initiated the connection and to correctly route incoming return traffic [24](#page=24) [25](#page=25).
> **Tip:** The use of unique source port numbers by the NAT router is essential for distinguishing between multiple internal devices that might be using the same private IP address for outgoing connections [25](#page=25).
### 2.2 Internet Control Message Protocol (ICMP)
ICMP is a support protocol for the Internet Protocol (IP) that plays a vital role in error reporting and network queries. It provides essential feedback mechanisms for network devices [26](#page=26).
#### 2.2.1 ICMP message encapsulation
ICMP messages are not standalone entities; they are encapsulated within IP packets for transmission across the network. This means an ICMP message has an IP header surrounding its own header and data [27](#page=27).
#### 2.2.2 ICMP message types
ICMP messages are broadly categorized into two main types: error reporting and query messages [29](#page=29).
##### 2.2.2.1 Error reporting messages
These messages are generated by network devices to inform the sender of a problem encountered while processing an IP packet. Examples include destination unreachable, time exceeded, and parameter problem messages [29](#page=29).
##### 2.2.2.2 Query messages
Query messages are used to probe network devices for information. Common examples include echo request and echo reply messages, which are the basis for the `ping` utility [29](#page=29) [30](#page=30).
#### 2.2.3 Diagnostic tools utilizing ICMP
**Ping**
The `ping` command utilizes ICMP echo request and echo reply messages to test the reachability of a host and measure the round-trip time for packets. When you ping a host, your computer sends an ICMP echo request, and if the host is reachable and configured to respond, it sends back an ICMP echo reply [30](#page=30).
> **Example:** A successful ping command indicates that a network path exists between the source and destination, and that the destination host is online and responsive to ICMP echo requests.
**Traceroute**
The `traceroute` (or `tracert` on Windows) utility uses ICMP messages to map the path that packets take to reach a destination. It works by sending a series of IP packets with incrementally increasing Time To Live (TTL) values. Each router along the path decrements the TTL. When the TTL reaches zero, the router sends back an ICMP "Time Exceeded" message. By collecting these ICMP messages, `traceroute` identifies each hop in the path [31](#page=31) [32](#page=32).
> **Tip:** `traceroute` is invaluable for identifying network bottlenecks or where connectivity is failing along a path [31](#page=31).
---
# Exam preparation and lecture summary
This section covers exam preparation through a detailed walkthrough of a sample networking question involving DHCP, ARP, and ICMP, followed by a summary of key network layer concepts.
### 3.1 Sample exam question and solution
The provided sample question focuses on understanding the interplay between DHCP, ARP, and ICMP in a typical network scenario. The solution details the packet flow and protocol interactions from the perspective of a laptop after DHCP has completed [34](#page=34).
#### 3.1.1 Packet sequence and protocol analysis
Following a DHCP lease, a laptop needs to communicate with a DNS server and a router. This process involves several steps utilizing different network protocols [34](#page=34):
* **Frame 1: ARP request for DNS server MAC address**
* The laptop knows the IP address of the DNS server but needs its MAC address to send data directly.
* An ARP request is broadcast, asking "Who has IP address [IP(DNS)?" [34](#page=34).
* This request originates from the laptop's MAC and IP address: `[MAC(Laptop), IP(Laptop)]` and is sent to the broadcast MAC address `[MAC(*)]` [34](#page=34).
* **DNS server's ARP reply and DNS request/reply**
* The DNS server responds with its MAC address, allowing the laptop to resolve the DNS server's identity [34](#page=34).
* Subsequently, the DNS request and reply messages are exchanged, and these packets pass through the router to reach the DNS server [34](#page=34).
* **Frame 2: ARP request for router MAC address**
* The laptop needs to send traffic to a destination outside its local network, requiring it to know the MAC address of its default gateway (the router).
* An ARP request is sent asking "Who has IP address [IP(Router)?" [34](#page=34).
* Similar to the previous ARP request, this originates from `[MAC(Laptop), IP(Laptop)]` and is sent to `[MAC(*)]` [34](#page=34).
* **Frame 3: ARP reply for router**
* The router responds to the ARP request with its MAC address and IP address [34](#page=34).
* This reply is sent from the router's MAC and IP address `[MAC(Router), IP(Router)]` back to the laptop's MAC and IP address `[MAC(Laptop), IP(Laptop)]` [34](#page=34).
* **Frame 4: ICMP echo request for ping**
* Now that the laptop has the necessary MAC address for the router, it can initiate communication.
* A ping operation is demonstrated, involving an ICMP echo request [34](#page=34).
* This request is sent from the laptop's MAC and IP address `[MAC(Laptop), IP(Laptop)]` to the router's IP address, which is acting as the gateway to a specific computer `IP(DatorX)` [34](#page=34).
> **Tip:** Understanding the sequence of ARP requests and replies is crucial for diagnosing connectivity issues. Remember that ARP is used to resolve IP addresses to MAC addresses within a local network segment.
### 3.2 Summary of network layer concepts
The lecture's network layer content covered essential aspects of network configuration, addressing, and diagnostics [2](#page=2) [35](#page=35).
* **Network configuration:**
* **DHCP (Dynamic Host Configuration Protocol):** Used for automatically assigning IP addresses and other network configuration parameters to devices [35](#page=35).
* **Network addressing:**
* **ARP (Address Resolution Protocol):** Maps IP addresses to MAC addresses on a local network [35](#page=35).
* **DNS (Domain Name System):** Translates human-readable domain names into IP addresses [35](#page=35).
* **NAT (Network Address Translation):** Allows multiple devices on a private network to share a single public IP address [35](#page=35).
* **Network diagnostics:**
* **ICMP (Internet Control Message Protocol):** Used for sending error messages and operational information, such as ping requests and replies, to report on network conditions [35](#page=35).
> **Example:** When you type a website address into your browser, DNS translates that name into an IP address. If the website is on a different network, your computer uses ARP to find the MAC address of your router (default gateway), and then sends the request through the router using ICMP (e.g., via a ping) to confirm reachability. DHCP ensures your computer has a valid IP address to start this process.
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Dynamic Host Configuration Protocol (DHCP) | A network management protocol used to automatically assign IP addresses and other network configuration parameters to devices on a network, simplifying administration. |
| Address Resolution Protocol (ARP) | A protocol used to discover the link layer address, such as a MAC address, associated with a given Internet Layer address, typically an IPv4 address, on a local network segment. |
| Domain Name System (DNS) | A hierarchical and decentralized naming system for computers, services, or any resource connected to the Internet or a private network, which translates domain names into the numerical IP addresses needed for locating computer services and devices worldwide. |
| Network Address Translation (NAT) | A method used by firewalls and routers to modify the IP address information in packet headers while they are in transit, allowing multiple devices on a private network to share a single public IP address. |
| Internet Control Message Protocol (ICMP) | A network layer protocol used by network devices, like routers, to send error messages and operational information indicating, for example, that a requested service is not available or that a host or router could not be reached. |
| IP Address | A unique numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. It serves to identify and locate hosts on the network. |
| MAC Address | A unique identifier assigned to network interfaces for communications at the data link layer of a network segment. It is often referred to as a physical address or hardware address. |
| Default Gateway | The node (typically a router) on a computer network that serves as the access point to devices on other networks. It is the first hop for packets destined for addresses outside the local network. |
| Recursive Resolution (DNS) | A DNS query process where a DNS resolver makes all necessary queries on behalf of the client until it receives a definitive answer (either the IP address or an indication that the name does not exist). |
| Iterative Resolution (DNS) | A DNS query process where a DNS resolver asks a series of DNS servers for information, with each server providing the next server to query until the final answer is obtained. |
| ICMP Echo Request | An ICMP message sent by a host to a target host to elicit an ICMP Echo Reply, commonly used by the `ping` utility to test network connectivity and measure round-trip time. |
| Traceroute | A network diagnostic tool used to trace the route packets take to a destination network. It shows the intermediate routers (hops) and the latency to each hop. |
Cover
eitf45 -L7- transport layer TCP and beyond APP.pdf
Summary
# Introduction to the transport layer
The transport layer provides logical end-to-end communication between processes running on different hosts [6](#page=6).
### 1.1 Role of the transport layer
The transport layer is responsible for process-to-process delivery, ensuring that data reaches the correct application on a host. It sits above the network layer (Layer 3) and below the application layer (Layer 5 in some models, implicitly). In the TCP/IP model, the transport layer provides services to the application layer. It handles the encapsulation and decapsulation of data [4](#page=4) [5](#page=5) [6](#page=6) [7](#page=7).
### 1.2 Transport layer protocols
The two primary protocols operating at the transport layer are:
* **Transmission Control Protocol (TCP)**
* **User Datagram Protocol (UDP)**
### 1.3 Process-to-process delivery
The transport layer enables communication between multiple applications running on the same host. This is achieved by using a combination of logical addresses (like IP addresses) and port numbers [7](#page=7).
#### 1.3.1 Logical and port addresses
To achieve process-to-process delivery, the transport layer uses:
* **Logical addresses:** Typically IP addresses, which identify a specific host on a network [8](#page=8).
* **Port numbers:** Which identify a specific process or application running on a host [8](#page=8) [9](#page=9).
#### 1.3.2 Socket addresses
A **socket address** is the unique combination of an IP address and a port number. This combination uniquely identifies a specific process on a host and is used for end-to-end communication [10](#page=10).
> **Tip:** Think of the IP address as the street address of a building, and the port number as the apartment number within that building. Both are needed to reach a specific resident (process).
#### 1.3.3 Port numbers
Port numbers are crucial for multiplexing and demultiplexing data at the transport layer. They are managed by the Internet Cooperation for Assigned Names and Numbers (ICANN) via the Internet Assigned Numbers Authority (IANA). There are three types of port numbers [11](#page=11) [8](#page=8):
* **Well-known ports:** These are assigned and controlled by IANA and are typically used by common system services (e.g., HTTP on port 80) [11](#page=11).
* **Registered ports:** Applications can register these ports with IANA to prevent duplication and ensure proper identification [11](#page=11).
* **Dynamic (or ephemeral) ports:** These are not controlled or registered and are used by applications for temporary communication sessions [11](#page=11).
The port number ranges for TCP and UDP are:
* **TCP:** 0 to 65535 [12](#page=12).
* **UDP:** 0 to 65535 [12](#page=12).
> **Example:** A web server typically listens on port 80 (for HTTP) or port 443 (for HTTPS). When a web browser client connects, it uses a dynamic port to establish communication with the server's well-known port.
### 1.4 Client-server concept
The client-server model is fundamental to network communication and relies heavily on the transport layer.
* **Server:** A server is a process that provides a service and must be continuously reachable on a specific port. It typically listens for incoming connection requests [13](#page=13) [14](#page=14).
* **Client:** A client is a process that requests a service from a server. When a client initiates a connection, it uses its own IP address and a dynamically assigned port number to communicate with the server's IP address and well-known (or registered) port number [14](#page=14).
> **Tip:** The server generally waits for clients, while clients actively initiate contact with servers. This interaction is facilitated by socket addresses at the transport layer.
---
# Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP) provides a connection-oriented, reliable service for data transmission [15](#page=15).
### 2.1 Core characteristics
TCP is defined by its connection-oriented nature, its byte stream service, and its reliability features which include flow control, error control, and congestion control [15](#page=15).
### 2.2 Connection establishment and termination
TCP uses a three-way handshake for connection establishment. This involves the client sending a SYN segment, the server responding with a SYN-ACK segment, and the client finally sending an ACK segment to acknowledge the server's SYN-ACK [18](#page=18).
Connection termination is typically a four-way handshake. Either side can initiate termination by sending a FIN segment, which is then acknowledged by an ACK from the other side. This process continues until both sides have sent and acknowledged their FIN segments, thereby closing the connection. A "half-close" is also possible, where one side closes its sending ability while the other can still send data [20](#page=20) [21](#page=21).
### 2.3 Data transfer
During data transfer, TCP segments data into packets. The sequence numbers within TCP headers are crucial for ordering these segments correctly at the receiver, ensuring the data is presented as a continuous byte stream. Acknowledgements (ACKs) are used to confirm the successful receipt of data segments [19](#page=19) [23](#page=23).
> **Tip:** TCP presents data to applications as a byte stream, abstracting away the packetization process and providing a seamless data flow [15](#page=15).
### 2.4 Error control
TCP offers reliable data transfer by implementing error control mechanisms. This is especially important because the underlying Internet Protocol (IP) provides an unreliable network layer service [22](#page=22).
#### 2.4.1 Mechanisms for error detection and correction
* **Checksum:** TCP includes a checksum in its header to detect corrupted segments [23](#page=23).
* **Acknowledgement (ACK):** The receiver sends ACK segments to acknowledge received data [23](#page=23).
* **Retransmission:** If a segment is lost or corrupted, TCP employs retransmission strategies:
* **After time-out:** If an ACK is not received within a certain time interval, the sender assumes the segment was lost and retransmits it [23](#page=23).
* **After 3 duplicate ACKs:** If the sender receives three duplicate ACKs for the same segment, it infers that the next segment has been lost and initiates a fast retransmission [23](#page=23) [26](#page=26).
#### 2.4.2 Scenarios of packet loss
* **Normal operation:** Data segments and acknowledgements are received successfully, and the connection progresses as expected [24](#page=24).
* **Lost segment:** A data segment sent by the sender is lost in transit. The receiver will not send an ACK for this segment, leading to a timeout at the sender or the reception of duplicate ACKs for previously sent segments [25](#page=25).
* **Fast retransmission:** Triggered by multiple duplicate ACKs, this allows for quicker retransmission of a presumed lost segment without waiting for a full timeout [26](#page=26).
### 2.5 Congestion control
Congestion occurs when the data load exceeds the network's capacity, leading to increased arrival rates compared to processing or departure rates. TCP actively manages congestion to maintain a functioning network and ensure smooth data flow, particularly for real-time applications [27](#page=27) [28](#page=28).
#### 2.5.1 Congestion avoidance
TCP employs various algorithms for congestion avoidance. A fundamental mechanism used is the sliding window approach, which dynamically adjusts the amount of data that can be sent before requiring an acknowledgement [29](#page=29).
### 2.6 Summary and comparison with multimedia performance requirements
TCP is highly sensitive to lost or corrupted packets and less sensitive to delay. This contrasts with multimedia applications, which are often sensitive to delay and jitter but more tolerant of packet loss or corrupted packets. TCP also does not support multicasting [30](#page=30).
> **Example:** A file transfer over TCP will ensure that the entire file is received correctly, even if some packets are lost and need to be retransmitted. This reliability is crucial for data integrity but can introduce delays. In contrast, a video stream might tolerate some dropped frames (packet loss) to maintain a smoother playback experience, prioritizing timeliness over absolute perfection.
---
# User Datagram Protocol (UDP)
User Datagram Protocol (UDP) is a transport layer protocol that provides a connectionless and unreliable service for process-to-process communication [31](#page=31) [34](#page=34).
### 3.1 Core characteristics of UDP
UDP's fundamental characteristics define its operational paradigm:
* **Connectionless:** UDP does not establish a persistent connection before sending data. Each datagram is sent independently, without any session setup or teardown. This means there's no handshake or agreement between sender and receiver to prepare for data transfer [31](#page=31) [32](#page=32).
* **Unreliable:** UDP does not guarantee delivery of datagrams. It lacks mechanisms for error control (detecting and correcting errors) and flow control (managing the rate of data transmission to prevent overwhelming the receiver). Consequently, datagrams can be lost, duplicated, or arrive out of order [31](#page=31) [33](#page=33).
* **Process-to-process delivery:** Like TCP, UDP enables communication between specific processes running on different hosts, using port numbers to identify these processes [34](#page=34).
### 3.2 UDP header format
The UDP header is simple and concise, containing only essential fields to support its connectionless and unreliable nature. The header consists of four fields, each 16 bits in length [33](#page=33):
* **Source Port (16 bits):** Identifies the port number of the sending process [33](#page=33).
* **Destination Port (16 bits):** Identifies the port number of the receiving process [33](#page=33).
* **Length (16 bits):** Specifies the total length of the UDP datagram, including the header and the data. The minimum length is 8 bytes (the size of the header) [33](#page=33).
* **Checksum (16 bits, optional):** Used for error detection. If the sender computes a checksum, the receiver will verify it. If the checksum is zero, it indicates that the checksum field is not used [33](#page=33).
> **Tip:** Because UDP lacks the overhead of connection establishment, error checking, and flow control found in TCP, it offers lower latency and higher throughput, making it suitable for applications where speed is paramount and occasional data loss is acceptable.
### 3.3 Comparison with TCP
The primary differentiator between UDP and TCP lies in their service models and associated trade-offs:
* **Connection:** TCP is connection-oriented, requiring a handshake to establish a connection before data transfer and a termination sequence to close it. UDP is connectionless, sending datagrams without prior setup [31](#page=31) [34](#page=34).
* **Reliability:** TCP provides reliable delivery through mechanisms like acknowledgments, retransmissions, and sequencing. UDP offers no such guarantees, making it unreliable [31](#page=31) [33](#page=33).
* **Ordering:** TCP ensures that data arrives in the order it was sent. UDP datagrams may arrive out of order, as there is no numbering or sequence tracking between them [33](#page=33).
* **Flow Control:** TCP manages the data flow rate to prevent receiver overload. UDP does not implement flow control [31](#page=31).
* **Header Size:** The UDP header is significantly smaller (8 bytes) than the TCP header (typically 20 bytes), contributing to its lower overhead [33](#page=33).
* **Quality of Service (QoS):** UDP's lack of reliability and statefulness makes it less suitable for applications with strict QoS requirements that demand guaranteed delivery and ordering. TCP, with its built-in reliability, is often preferred for such applications. However, UDP can be used in conjunction with application-level mechanisms to achieve specific QoS goals for certain types of real-time traffic.
> **Example:** Applications like online gaming, voice over IP (VoIP), and streaming media often utilize UDP because timely delivery of packets is more critical than guaranteed delivery of every single packet. A dropped voice packet is less disruptive than a delay caused by retransmission.
---
# Application Layer: HTTP Revisited
This section revisits the Hypertext Transfer Protocol (HTTP) to understand its role in the application layer, detailing its text-based nature, the request-response interaction, and its reliance on TCP connections for communication [35](#page=35) [36](#page=36).
### 4.1 Introduction to HTTP
HTTP is a text-based protocol that forms the foundation of data communication on the World Wide Web. It operates at the application layer and defines the structure of messages exchanged between clients (like web browsers) and servers [35](#page=35) [36](#page=36) [41](#page=41).
### 4.2 HTTP Message Types: Requests and Responses
HTTP employs two fundamental types of messages: requests sent by the client to the server, and responses sent by the server back to the client [36](#page=36).
### 4.3 HTTP and TCP Connections
HTTP establishes and utilizes Transmission Control Protocol (TCP) connections for its communication [36](#page=36).
#### 4.3.1 Persistent vs. Non-persistent HTTP
* **Non-persistent HTTP:** In this model, a new TCP connection is established for each HTTP request-response transaction. After the response is delivered, the TCP connection is closed. This means that for a single HTML page containing multiple embedded objects (like images or stylesheets), multiple TCP connections might be opened and closed sequentially [38](#page=38).
* **Persistent HTTP:** With persistent HTTP, a single TCP connection is maintained for multiple request-response transactions. This improves efficiency by reducing the overhead associated with establishing new connections repeatedly [38](#page=38).
#### 4.3.2 Document Retrieval with HTTP
The process of retrieving a document, such as a web page, involves a series of interactions. A client sends an HTTP request to a server. The server processes the request and sends back an HTTP response. If the document contains embedded objects, the client may need to initiate further requests for these objects [37](#page=37) [38](#page=38).
#### 4.3.3 HTTP Request Structure
An HTTP request message typically includes:
* A request line, specifying the HTTP method (e.g., GET, PUT), the URI of the requested resource, and the HTTP version [37](#page=37).
* Header lines, providing additional information about the request, such as the host, user-agent, and acceptable content types.
* An optional message body, used for methods like POST to send data to the server.
#### 4.3.4 HTTP Response Structure
An HTTP response message typically includes:
* A status line, indicating the HTTP version, a status code (e.g., 200 OK, 404 Not Found), and a reason phrase [37](#page=37).
* Header lines, providing information about the response, such as the content type, content length, and server details.
* An optional message body, containing the requested resource (e.g., HTML content, image data).
> **Tip:** Understanding the structure of HTTP requests and responses is crucial for debugging network issues and for developing web applications [37](#page=37).
#### 4.3.5 Methods in HTTP
HTTP supports various methods that define the action to be performed on a resource. Common methods include:
* **GET:** Requests a representation of the specified resource [37](#page=37).
* **PUT:** Uploads a representation of the specified resource [37](#page=37).
* Other methods exist for different operations.
### 4.4 The Role of the Network Model
HTTP fits within the broader context of network models. It operates at the application layer, which is the topmost layer in many network models. This layer is responsible for providing network services directly to end-user applications. Protocols at this layer, like HTTP, enable users to interact with the network [41](#page=41).
> **Tip:** Recall that the application layer provides the interface between the user's applications and the underlying network infrastructure [41](#page=41).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Transport Layer | The layer in the TCP/IP model responsible for logical end-to-end communication between processes running on different hosts, providing services like process-to-process delivery and data segmentation. |
| Process-to-Process Delivery | A service provided by the transport layer that ensures data is delivered from a specific application process on a source host to a specific application process on a destination host. |
| TCP (Transmission Control Protocol) | A connection-oriented, reliable transport layer protocol that provides services such as flow control, error control, and congestion control to ensure accurate data delivery. |
| UDP (User Datagram Protocol) | A connectionless, unreliable transport layer protocol that offers a minimal service, primarily focused on sending datagrams without guarantees of delivery, order, or error checking. |
| Datagram | A self-contained unit of data exchanged at the network layer, consisting of a header and a payload, which is routed independently across the network. |
| Packet | A unit of data transmitted over a network. In the context of the TCP/IP model, "packet" can refer to data at the network layer. |
| Frame | A unit of data at the data link layer, typically containing a network layer packet, along with data link layer headers and trailers for transmission over a physical medium. |
| Segment | A unit of data at the transport layer, specifically referring to data handled by TCP. TCP segments are encapsulated within IP packets. |
| IP Address | A unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. |
| Port Number | A number used by transport layer protocols (like TCP and UDP) to identify a specific process or service running on a host, enabling multiplexing and demultiplexing of data. |
| Socket Address | A combination of an IP address and a port number, uniquely identifying a specific communication endpoint for a process on a host. |
| Well-known Ports | A range of port numbers (0-1023) assigned by the Internet Assigned Numbers Authority (IANA) for well-established network services like HTTP, FTP, and SMTP. |
| Registered Ports | A range of port numbers (1024-49151) that can be registered with IANA for specific applications to avoid port number conflicts. |
| Dynamic (Ephemeral) Ports | A range of port numbers (49152-65535) that are not controlled or registered and can be used by applications for temporary communication sessions. |
| Connection-Oriented | A type of communication where a dedicated connection is established between two endpoints before data transmission begins, ensuring ordered and reliable delivery. TCP is connection-oriented. |
| Connectionless | A type of communication where data is sent without establishing a prior connection. Each data unit is transmitted independently, and there are no guarantees of delivery or order. UDP is connectionless. |
| Byte Stream Service | A service provided by TCP where data is treated as a continuous stream of bytes, allowing applications to send and receive data without explicit message boundaries. |
| Flow Control | A mechanism used by transport layer protocols to prevent a fast sender from overwhelming a slow receiver, by managing the rate of data transmission. |
| Error Control | A mechanism used to detect and correct errors that may occur during data transmission, ensuring the integrity and reliability of the received data. |
| Congestion Control | A mechanism used by transport layer protocols to manage the amount of data sent into the network, aiming to prevent or alleviate network congestion. |
| Checksum | A value calculated from a block of data used to detect errors that may have been introduced during transmission or storage. |
| Acknowledgement (ACK) | A control message sent by the receiver to the sender to confirm that a specific segment or block of data has been successfully received. |
| Retransmission | The process of sending data again after it has been lost or corrupted during transmission, typically triggered by timeouts or duplicate acknowledgments. |
| Fast Retransmission | A TCP mechanism where a sender retransmits a segment immediately upon receiving multiple duplicate acknowledgments (usually three), indicating that a segment is likely lost. |
| Quality of Service (QoS) | A set of technologies and techniques used to manage network traffic and ensure that performance requirements, such as delay, jitter, and bandwidth, are met for different applications. |
| Congestion | A network condition where the amount of data being transmitted exceeds the network's capacity, leading to increased delays and packet loss. |
| Sliding Window | A flow control and congestion control mechanism used by TCP that allows the sender to transmit multiple segments before waiting for an acknowledgment, dynamically adjusting the window size. |
| Jitter | The variation in the delay of received packets, which can significantly impact the quality of real-time multimedia applications like voice and video. |
| HTTP (Hypertext Transfer Protocol) | An application layer protocol used for transmitting hypermedia documents, such as HTML, on the World Wide Web. It defines how messages are formatted and transmitted. |
| HTTP Request | A message sent from a client to a server asking for a specific resource or action. Common methods include GET and POST. |
| HTTP Response | A message sent from a server to a client in reply to an HTTP request, typically containing the requested resource or a status code indicating the outcome of the request. |
Cover
EITF45 övning 2 (FL4) Feldetektering och hantering uppgifter med lösningar.pdf
Summary
# Cyclic redundancy check (CRC) calculation and verification
This section outlines the process of calculating Cyclic Redundancy Check (CRC) bits for given messages using a generator polynomial and verifying received sequences for errors [2](#page=2).
### 1.1 CRC calculation on the sender side
The sender's goal is to compute the CRC bit sequence, denoted as $R(x)$, for a given outbound bit sequence $M(x)$ to produce the final transmitted sequence $F(x)$. This is achieved by appending the calculated CRC bits to the message bits [2](#page=2).
#### 1.1.1 Polynomial representation of bit sequences
Bit sequences can be represented as polynomials in $x$. This conversion is done by assigning powers of $x$ from right to left, starting with $x^0$ for the rightmost bit. For example, the bit sequence `011001` is represented as $0 \cdot x^5 + 1 \cdot x^4 + 1 \cdot x^3 + 0 \cdot x^2 + 0 \cdot x^1 + 1 \cdot x^0$, which simplifies to $x^4 + x^3 + 1$ [2](#page=2).
#### 1.1.2 Preparing the message polynomial
To make space for the CRC bits, the message polynomial $M(x)$ is multiplied by $x^k$, where $k$ is the degree of the CRC generator polynomial $C(x)$. This shifted sequence is denoted as $B(x) = M(x) \cdot x^k$ [2](#page=2).
#### 1.1.3 Calculating the CRC remainder
The CRC bits $R(x)$ are determined by dividing the polynomial $B(x)$ by the generator polynomial $C(x)$ using modulo-2 arithmetic. The remainder of this division is the CRC bit sequence $R(x)$ [2](#page=2).
#### 1.1.4 Forming the transmitted sequence
The final transmitted polynomial, $P(x)$, is formed by appending the CRC remainder $R(x)$ to the shifted message polynomial $B(x)$. Mathematically, this can be expressed as $P(x) = B(x) + R(x)$. Importantly, this resulting polynomial $P(x)$ will be evenly divisible by the generator polynomial $C(x)$ [2](#page=2).
**Example Calculation:**
Given $C(x) = x^3 + x^2 + 1$, which means $k = 3$ [2](#page=2).
**(a) Message: `00111010`**
$M(x) = x^5 + x^4 + x^3 + x$ [2](#page=2).
$B(x) = M(x) \cdot x^3 = (x^5 + x^4 + x^3 + x) \cdot x^3 = x^8 + x^7 + x^6 + x^4$ [2](#page=2).
Dividing $B(x)$ by $C(x)$ (modulo-2):
$x^8 + x^7 + x^6 + x^4 \div x^3 + x^2 + 1$
The remainder $R(x)$ is $x$ [2](#page=2).
The CRC bits are `010` (representing $x$) [2](#page=2).
**(b) Message: `1010011110`**
$C(x) = x^3 + x^2 + 1$, so $k = 3$ [2](#page=2).
$M(x) = x^9 + x^7 + x^4 + x^3 + x^2 + x$ [2](#page=2).
$B(x) = M(x) \cdot x^3 = (x^9 + x^7 + x^4 + x^3 + x^2 + x) \cdot x^3 = x^{12} + x^{10} + x^7 + x^6 + x^5 + x^4$ [2](#page=2).
Dividing $B(x)$ by $C(x)$ (modulo-2):
$x^{12} + x^{10} + x^7 + x^6 + x^5 + x^4 \div x^3 + x^2 + 1$
The remainder $R(x)$ is $x^2 + 1$ [2](#page=2).
The CRC bits are `101` (representing $x^2+1$) [2](#page=2).
### 1.2 CRC verification on the receiver side
On the receiver side, the process involves checking if the received bit sequence is divisible by the same generator polynomial $C(x)$ used by the sender [3](#page=3).
#### 1.2.1 Verification process
If the received sequence $P(x)$ (which includes the message and CRC bits) is evenly divisible by $C(x)$ using modulo-2 arithmetic, it means there were no errors during transmission, or the errors were not detected. In this case, the remainder $E(x)$ will be 0 [3](#page=3).
If the remainder $E(x)$ is 0, the appended CRC bit sequence of length $k$ can be removed from the received sequence to recover the original message $M(x)$ [3](#page=3).
If the remainder $E(x)$ is not 0, it indicates that an error has occurred during transmission, and the received message is deemed invalid (NOK) [3](#page=3).
**Example Verification:**
Given $C(x) = x^4 + x^3 + 1$, so $k = 4$ [3](#page=3).
**(a) Received sequence: `11010111`**
$P(x) = x^7 + x^6 + x^4 + x^2 + x + 1$ [3](#page=3).
Dividing $P(x)$ by $C(x)$ (modulo-2):
$x^7 + x^6 + x^4 + x^2 + x + 1 \div x^4 + x^3 + 1$
The remainder $E(x)$ is $x^2 + x$ [3](#page=3).
Since $E(x) \ne 0$, the sequence is rejected (NOK) [3](#page=3).
**(b) Received sequence: `10101101101`**
$P(x) = x^{10} + x^8 + x^6 + x^5 + x^3 + x^2 + 1$ [3](#page=3).
Dividing $P(x)$ by $C(x)$ (modulo-2):
$x^{10} + x^8 + x^6 + x^5 + x^3 + x^2 + 1 \div x^4 + x^3 + 1$
The remainder $E(x)$ is $x^3 + x^2 + 1$ [3](#page=3).
Since $E(x) \ne 0$, the sequence is rejected (NOK) [3](#page=3).
**(c) Received sequence: `10001110111`**
$P(x) = x^{10} + x^6 + x^5 + x^4 + x^2 + x + 1$ [3](#page=3).
Dividing $P(x)$ by $C(x)$ (modulo-2):
$x^{10} + x^6 + x^5 + x^4 + x^2 + x + 1 \div x^4 + x^3 + 1$
The remainder $E(x)$ is $0$ [3](#page=3).
Since $E(x) = 0$, the sequence is accepted (OK) [3](#page=3).
### 1.3 Undetectable errors
It is possible for certain errors to be introduced such that the receiver cannot detect them. If an error sequence $e(x)$ is added to the transmitted codeword $c(x)$, the receiver calculates $(c(x) + e(x)) / g(x)$. If the remainder is 0, the message is accepted as correct. This occurs if $e(x)$ is a multiple of the generator polynomial $g(x)$, i.e., $e(x) = a \cdot g(x)$ for some polynomial $a$. In this case, $(c(x) + a \cdot g(x)) / g(x)$ will have a remainder of 0 because $c(x)/g(x)$ has a remainder of 0 and $a \cdot g(x)/g(x)$ also has a remainder of 0 [4](#page=4).
**Example of undetectable errors:**
Given a generator polynomial $g(x) = x^3+x+1$ (degree $k=3$). If the transmitted codeword is $c(x) = 1010011010110$, and an error sequence $e(x)$ that is a multiple of $g(x)$ is added, the error might go undetected. For example, if $e(x) = 1011$ (representing $x^3+1$), which is a multiple of $g(x)$, then the received sequence might be accepted as valid. Other examples of undetectable error sequences include `1010011000000` or `1010011001011` [4](#page=4).
---
# Checksum calculation and verification
This topic details the calculation and verification of an 8-bit checksum for bit sequences.
### 2.1 Checksum calculation
The checksum is generated by performing a bitwise addition of the data segments, considering any remainder as a carry to the next digit. For an n-bit checksum, this process involves the bitwise sum of n-bit data sequences, and the inverse of the resulting bit sequence is then appended to the original data for transmission. This means an n-bit checksum is the inverse of the bit-wise sum of size n data bit-sequences [4](#page=4).
#### 2.1.1 Example calculation
Let's consider the calculation of an 8-bit checksum for given bit sequences:
**(a) Sequence: 10010011 10010011**
The two halves are added bitwise from right to left, carrying over any remainder.
```
10010011
+ 10010011
-----------
100100110 (Intermediate sum with carry)
```
Performing the bitwise addition with carry consideration:
```
10010011
+ 10010011
-----------
00100110 (Lower 8 bits of sum)
+ 1 (Carry from the most significant bit addition)
-----------
00100111 (Final 8-bit sum)
```
The 8-bit checksum is the inverse of this final 8-bit sum.
Inverse of `00100111` is `11011000`.
Therefore, the transmitted codeword would be `10010011 10010011 11011000`.
The provided answer is `11011000` [4](#page=4).
**(b) Sequence: 00011001 01010011**
Adding the two halves:
```
00011001
+ 01010011
-----------
01101100 (Final 8-bit sum)
```
The inverse of `01101100` is `10010011`.
Therefore, the transmitted codeword would be `00011001 01010011 10010011`.
The provided answer is `10010011` [5](#page=5).
**(c) Sequence: 11000111 00001101**
Adding the two halves:
```
11000111
+ 00001101
-----------
11010010 (Final 8-bit sum)
```
The inverse of `11010010` is `00101011`.
Therefore, the transmitted codeword would be `11000111 00001101 00101011`.
The provided answer is `00101011` [5](#page=5).
> **Tip:** The calculation involves standard binary addition with carry-over. Remember that the checksum itself is the *inverse* of the final sum of the data segments.
### 2.2 Checksum verification
On the receiver's side, the incoming sequence is subjected to a bitwise summation, treating the received data and the checksum as separate n-bit sections. The sum is calculated in the same manner as during transmission. The resulting sum's inverse is then compared to the received checksum sequence. If the inverted sum matches the received checksum, the sequence is accepted as correct; otherwise, it is highly likely that errors were introduced during transmission [5](#page=5).
Alternatively, one can simply perform a bitwise addition of the *entire* received sequence (data + checksum). If the checksum was calculated correctly and no errors occurred, this total sum should result in all zeros [5](#page=5).
#### 2.2.1 Example verification
Let's verify the correctness of received bit sequences using an 8-bit checksum:
**(a) Received sequence: 10010011 10011011 11011001**
The sequence consists of two 8-bit data parts and one 8-bit checksum part.
Summing the data parts:
```
10010011
+ 10011011
-----------
00101110 (Sum of the first two 8-bit segments)
```
The received checksum is `11011001`.
We compare the inverse of the sum of the data parts with the received checksum.
Inverse of `00101110` is `11010001`.
Since `11010001` (inverted sum of data) $\neq$ `11011001` (received checksum), the sequence is deemed incorrect.
The provided answer is NOK [5](#page=5).
**(b) Received sequence: 00110011 10110111 00010101**
Summing the data parts:
```
00110011
+ 10110111
-----------
11101010 (Sum of the first two 8-bit segments)
```
The received checksum is `00010101`.
The inverse of `11101010` is `00010101`.
Since `00010101` (inverted sum of data) $=$ `00010101` (received checksum), the sequence is accepted.
The provided answer is OK [5](#page=5).
**(c) Received sequence: 01110000 00111000 01010111**
Summing the data parts:
```
01110000
+ 00111000
-----------
01101000 (Sum of the first two 8-bit segments)
```
The received checksum is `01010111`.
The inverse of `01101000` is `10010111`.
Wait, let's re-calculate carefully.
Summing the data parts:
```
01110000
+ 00111000
-----------
01101000
```
The received checksum is `01010111`.
Let's try summing the *entire* sequence including the checksum:
```
01110000 (Data 1)
+ 00111000 (Data 2)
+ 01010111 (Checksum)
-----------
11101111 (Total Sum)
```
This sum is not zero. This indicates an issue with either the provided solution for (c) or my interpretation of the calculation process for (c) in the document. Let's re-examine the document's stated sum for (c): "Sum: 01010111". This implies that the calculation performed on the receiver side *resulted* in `01010111`. The document states the answer is OK. This suggests that the 'Sum' line in the solution refers to the *result* of summing the data segments, and this result, when inverted, should match the checksum.
Let's assume the "Sum" refers to the sum of the data segments.
Data 1: `01110000`
Data 2: `00111000`
Sum of Data: `01110000 + 00111000 = 01101000`
Received Checksum: `01010111`
Inverse of Sum of Data: `\overline{01101000} = 10010111`
If the sequence is OK, then the inverted sum of data should equal the checksum.
`10010111 \neq 01010111`.
There seems to be a discrepancy in solution (c) of the provided document. However, following the described method:
The receiver sums the data segments. Let this sum be $S_{data}$.
The transmitted checksum $C$ is calculated as $C = \overline{S_{data}}$.
At the receiver, the incoming sequence is $D_1 D_2 C_{received}$.
The receiver calculates $S_{data\_received} = D_1 + D_2$.
It then checks if $\overline{S_{data\_received}} == C_{received}$.
If the document's "Sum" means the sum of the data segments:
For (c), $S_{data} = 01110000 + 00111000 = 01101000$.
The document states "Sum: 01010111". This implies that the *result of the summation of the data segments* is `01010111`. This contradicts the manual calculation.
Let's assume the "Sum: 01010111" in Solution 5(c) refers to the *entire received sequence's sum if it were correct*, which would be zero. Or, it might refer to the sum of the data segments that, when inverted, matches the checksum.
Let's use the total sum method as it's often simpler for verification. Sum all received bits:
$01110000$
$00111000$
$01010111$
----------
$11101111$
If this were zero, it would be OK. Since it's not, there's an error.
However, the document explicitly states "Answer: OK" for (c). Given the method "On the receiver side, the inbound sequence is bit-wise summed as sections of size n. The inverted result is compared to the checksum sequence", let's proceed assuming the "Sum" listed is the sum of the data segments and that this sum, when inverted, *should* match the checksum for the sequence to be OK.
For (c):
Data: `01110000` and `00111000`
Checksum: `01010111`
Document's stated sum of data: `01010111`.
Inverse of this sum: `\overline{01010111} = 10101000`.
This should match the checksum `01010111`. It does not.
There appears to be an inconsistency in the provided solution for 5(c). Sticking to the described method and assuming the provided "Sum" is indeed the bitwise sum of the data segments:
* Manual sum of data: `01101000`
* Inverted sum of data: `10010111`
* Received checksum: `01010111`
* Comparison: `10010111 \neq 01010111`
This would lead to NOK. However, the document says OK.
Let's consider another interpretation: perhaps the "Sum" line in the solution is the actual computed sum of the *entire* received block (data + checksum) and for a correct block, this sum should be zero.
For (c):
Sum of all bits = $01110000 + 00111000 + 01010111 = 11101111$.
This is not zero.
The most consistent interpretation, given the phrasing "The inverted result is compared to the checksum sequence", is that the "Sum" refers to the sum of the data segments, and its inverse must match the checksum. The document's answer for (c) appears to be erroneous based on the calculation.
However, for the purpose of this study guide, we will adhere to the document's stated answers.
Recalculating (c) based on the stated "Sum: 01010111" for the data parts:
Sum of data parts (as per document): `01010111`
Inverse of this sum: `\overline{01010111} = 10101000`.
Received checksum: `01010111`.
If the sequence is OK, then the inverted sum of data must equal the checksum.
According to the document, for (c) "Sum: 01010111" and "Answer: OK". This implies that the checksum is indeed the inverse of the sum of the data segments, *and* the listed sum `01010111` refers to the sum of the data segments [5](#page=5).
Let's assume the sum of data for (c) is indeed `01010111`. For the sequence to be OK, the inverse of this sum should be the checksum.
Inverse of `01010111` is `10101000`.
The received checksum is `01010111`.
For the sequence to be OK, it must be that `10101000 == 01010111`, which is false.
The only way for (c) to be OK is if the *sum of the entire block* (data + checksum) equals zero. Let's re-check that:
`01110000 + 00111000 + 01010111 = 11101111`. This is not zero.
Given the direct contradictions, the summary will follow the *methodology* described, and present the given results, noting the potential for discrepancy in (c).
**Verification Method Recap:**
1. Sum the data segments bitwise.
2. Calculate the inverse of this sum.
3. Compare this inverted sum to the received checksum. If they match, the sequence is OK.
Alternatively, sum all received bits (data + checksum). If the result is all zeros, the sequence is OK.
**(a) Received sequence: 10010011 10011011 11011001**
Sum of data: `10010011 + 10011011 = 00101110`
Inverse of sum: `\overline{00101110} = 11010001`
Received checksum: `11011001`
Comparison: `11010001 \neq 11011001`
Answer: NOK [5](#page=5).
**(b) Received sequence: 00110011 10110111 00010101**
Sum of data: `00110011 + 10110111 = 11101010`
Inverse of sum: `\overline{11101010} = 00010101`
Received checksum: `00010101`
Comparison: `00010101 == 00010101`
Answer: OK [5](#page=5).
**(c) Received sequence: 01110000 00111000 01010111**
(Following document's stated "Sum: 01010111" as the sum of data segments)
Sum of data (as per document): `01010111`
Inverse of this sum: `\overline{01010111} = 10101000`
Received checksum: `01010111`
Comparison: `10101000 \neq 01010111`
Answer: OK [5](#page=5).
> **Note:** There is an apparent inconsistency in the provided solution for 5(c). Based on the described calculation method, the sequence should likely be flagged as NOK. However, the document states it is OK. For exam preparation, ensure you can perform the calculation correctly. The method described is to sum the data segments, invert the result, and compare it to the checksum.
> **Tip:** When verifying, sum the entire block (data + checksum). If no errors occurred and the checksum was generated correctly, this total sum should be all zeros. Let's re-check (c) with this method:
> $01110000 + 00111000 + 01010111 = 11101111 \neq 00000000$.
> This further supports the observation of an inconsistency in the provided solution for (c).
---
# ARQ protocols and windowing mechanisms
This section delves into Automatic Repeat reQuest (ARQ) protocols, examining the fundamental principles of Stop-and-Wait and Go-Back-N, alongside the critical roles of sender window size and sequence numbering in reliable data transfer.
### 3.1 Automatic Repeat reQuest (ARQ) protocols
ARQ protocols are error control mechanisms used in data communication to ensure reliable data transmission. They operate by having the sender transmit data packets and the receiver acknowledge their successful reception. If a sender does not receive an acknowledgment within a certain time frame (timeout), it retransmits the packet, assuming it was lost or corrupted [8](#page=8).
#### 3.1.1 Stop-and-Wait ARQ
Stop-and-Wait ARQ is the simplest form of ARQ. In this protocol, the sender transmits one packet at a time and then waits for an acknowledgment (ACK) from the receiver before sending the next packet [8](#page=8).
* **Operation:**
1. The sender transmits a packet.
2. The sender starts a timer.
3. The receiver checks for errors. If the packet is error-free, it sends an ACK back to the sender.
4. If the sender receives the ACK before the timer expires, it sends the next packet.
5. If the timer expires before the ACK is received, the sender assumes the packet or the ACK was lost and retransmits the packet.
* **Efficiency:** Stop-and-Wait is inefficient because the sender is idle for most of the time, waiting for ACKs, especially over long distances where propagation delays are significant. For example, with a 4,000 km distance and light speed propagation, the round-trip time for an ACK can be 26.68 milliseconds while the transmission time for a 1000-byte frame at 100,000 kbps is only 0.08 milliseconds. This results in the sender being idle for 99.7% of the time [10](#page=10).
* **Packet Count Example:** If a sender attempts to send 5 packets and packet number 3 is lost, Stop-and-Wait would involve sending packet 1, 2, 3, 4, 5, receiving ACKs for 1, 2, 4, 5, and retransmitting packet 3 and its ACK. This results in a total of 11 packets (5 data + 5 ACK + 1 lost data) if the lost packet and final ACK are counted [8](#page=8).
#### 3.1.2 Go-Back-N ARQ
Go-Back-N ARQ improves efficiency by allowing the sender to transmit multiple packets before waiting for acknowledgments. It uses a sliding window mechanism.
* **Operation:**
1. The sender can send up to `W` packets (where `W` is the window size) without waiting for individual ACKs.
2. The receiver acknowledges the cumulative receipt of packets. For example, receiving an ACK for packet `k` implies that all packets from the beginning up to `k` have been received correctly.
3. If a packet is lost or corrupted, the receiver discards that packet and all subsequent packets until the lost packet is retransmitted.
4. The sender, upon detecting a timeout or receiving a duplicate ACK, will retransmit the lost packet and all subsequent packets within the current window that were already sent.
* **Window Size Constraint:** It is crucial that the maximum sender window size is less than $2^n$, where $n$ is the number of bits used for sequence numbers. This ensures that all possible sequence numbers can be uniquely identified within the window, preventing ambiguity between old, duplicated, and new frames [6](#page=6).
* **Packet Count Example:** In a Go-Back-N ARQ with a window size of 3, if packet 3 is lost among 5 transmitted packets, the sender sends packets 0, 1, 2. Packet 3 is lost. The receiver acknowledges packets 0, 1, 2. When packet 3 is lost, the receiver discards subsequent packets (e.g., 4) that arrive out of order. The sender retransmits packet 3 and then continues with packet 4. This scenario results in a total of 15 packets if the lost packet and final ACK are counted (5 initial data + 5 initial ACK + 1 lost data + 1 retransmitted data + 3 retransmitted ACK) [8](#page=8) [9](#page=9).
### 3.2 Windowing mechanisms and sequence numbering
Windowing mechanisms and sequence numbering are fundamental to efficient and reliable ARQ protocols.
#### 3.2.1 Sender Window Size
The sender window size ($W$) determines how many packets the sender can transmit without waiting for an acknowledgment [6](#page=6).
* **Purpose:** A larger window size allows for more concurrent transmissions, improving channel utilization and throughput, especially in networks with high latency.
* **Constraints:** As mentioned, for Go-Back-N, the window size must be strictly less than $2^n$ to avoid ambiguity [6](#page=6).
* `W < 2^n`
#### 3.2.2 Sequence Numbering
Sequence numbers are used to uniquely identify each packet and manage the order of transmission and reception.
* **Functionality:**
* **Identification:** Differentiate between unique packets.
* **Error Detection:** Detect duplicate packets (retransmissions).
* **Ordering:** Allow the receiver to reassemble packets in the correct order.
* **Number of bits ($n$):** The number of bits used for sequence numbers ($n$) determines the range of possible sequence numbers ($2^n$) [6](#page=6).
* **Window Representation:** In diagrams, the sender's window can be visualized using markers.
* `SF` (Sent Frame): Marks the last transmitted frame.
* `SLS` (Send Last Successfully acknowledged frame): Marks one frame after the last consecutively acknowledged frame, indicating the start of the open window. The window typically spans from `SLS` up to `SLS + W - 1` [6](#page=6).
> **Example:** Consider a 3-bit sequence number, allowing for $2^3 = 8$ unique sequence numbers (0-7). If the sender window size is 4 [6](#page=6):
>
> * **Initial state:** The window covers frames 0, 1, 2, 3. `SF` and `SLS` might both point to frame 0 initially, with the window encompassing frames 0 to 3 [6](#page=6).
> * **After sending 0, 1, 2 and receiving ACKs for 0, 1:** `SLS` moves to frame 2 (the earliest unacknowledged frame). The window now covers frames 2, 3, 4, 5. `SF` would point to frame 2 if only 0, 1, 2 were sent and ACKed. If frames 0, 1, 2, 3, 4, 5 were sent, and ACKs for 0, 1 were received, `SLS` would be 2 and `SF` would be 5 [6](#page=6) [7](#page=7).
> * **After sending 3, 4, 5, 6 and receiving ACK for 4:** `SLS` moves to frame 5 (since packet 4 is the highest acknowledged). `SF` would point to frame 6 (the highest sent frame). The window covers frames 5, 6, 7, 0 (due to modulo arithmetic on sequence numbers) [7](#page=7).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Cyclic Redundancy Check (CRC) | A method for detecting errors in data transmission. It involves appending a short, fixed-length checksum (the CRC) to a message, which is calculated based on the message content and a generator polynomial. The receiver recalculates the CRC and compares it to the received CRC to detect errors. |
| Generator Polynomial | A polynomial used in the calculation of CRC. It determines the properties of the CRC code, including its error detection capabilities. In binary representations, the coefficients of the polynomial correspond to the bits of the polynomial. |
| Modulo-2 Division | A division operation performed using binary arithmetic where addition and subtraction are equivalent to the XOR operation. This is fundamental in CRC calculations, as it is used to find the remainder when dividing the message polynomial by the generator polynomial. |
| Polynomial | A mathematical expression consisting of variables and coefficients, involving only the operations of addition, subtraction, and multiplication. In the context of error detection, bit sequences are often represented as polynomials where the position of a bit corresponds to the power of the variable. |
| Sender Window | In ARQ protocols, the sender window defines the set of sequence numbers for frames that the sender is allowed to transmit without waiting for an acknowledgment. This helps in managing the flow of data and improving efficiency. |
| Go-back-N ARQ | An Automatic Repeat reQuest (ARQ) protocol where the sender can send multiple frames (up to the window size) without waiting for individual acknowledgments. If a frame is lost or corrupted, the sender retransmits that frame and all subsequent frames that were sent. |
| Stop-and-Wait ARQ | A basic ARQ protocol where the sender transmits one frame and then waits for an acknowledgment (ACK) from the receiver before sending the next frame. This is simple but can be inefficient due to waiting times. |
| Sequence Number | A unique identifier assigned to each data packet or frame transmitted. Sequence numbers are crucial for the receiver to correctly reassemble the data in order and to detect duplicate or lost packets. |
| Checksum | A small-sized block of data derived from a larger block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. It is typically calculated by summing up the data in some way. |
| Transmission Speed | The rate at which data is transferred over a communication channel, usually measured in bits per second (bps). Higher transmission speeds allow for faster data transfer. |
| Propagation Delay | The time it takes for a signal to travel from the sender to the receiver. This is dependent on the distance and the speed of signal propagation (e.g., speed of light in a medium). |
| ACK (Acknowledgment) | A message sent by the receiver to the sender to confirm that a data packet or frame has been received successfully. |
Cover
EITF45 övning 3 (FL5) Internetprotokoll och adressering uppgifter med lösningar.pdf
Summary
# Comparison of OSI and TCP/IP models
This section details the fundamental differences between the OSI and TCP/IP network models, focusing on their layer structures and functional mappings [2](#page=2).
### 1.1 Overview of the models
The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of a telecommunication or computing system in terms of abstraction layers. The TCP/IP (Transmission Control Protocol/Internet Protocol) model is a more practical, widely implemented protocol suite that forms the basis of the internet [2](#page=2).
### 1.2 Layer comparison
A key distinction between the two models lies in their number of layers [2](#page=2).
* **OSI Model:** Consists of seven distinct layers [2](#page=2).
* **TCP/IP Model:** Typically considered to have three or four layers, depending on the interpretation [2](#page=2).
#### 1.2.1 Mapping of functionalities
The functionalities of the upper layers of the OSI model are consolidated into a single layer within the TCP/IP model. Specifically, the Application, Presentation, and Session layers of the OSI model are all encompassed by the Application layer of the TCP/IP model [2](#page=2).
The TCP/IP model does not explicitly define layers 1 (Physical) and 2 (Data Link) as separate entities in the same way the OSI model does. This is because the design allows for each network operator to implement their own network without strict adherence to TCP/IP's specific physical and link layer definitions, unlike early networks like ARPANET which had a unified link-level protocol and addressing system [2](#page=2).
> **Tip:** Understanding how functionalities are grouped differently is crucial for comprehending how data is processed and transmitted across networks using these models.
### 1.3 Internetworking and protocol purpose
The purpose of a network protocol is to ensure that data packets can be reliably sent from host to host across multiple interconnected networks. This is essential for internetworking, which allows data to traverse different networks that may not use the same underlying protocols. For internetworking to function, all participating networks must agree on common rules for addressing and forwarding data, necessitating a shared network protocol. Network equipment, such as routers, is responsible for forwarding data between these different networks [2](#page=2).
> **Example:** Without common network protocols and internetworking principles, each isolated network would be unable to communicate with any other, severely limiting the global reach and utility of data communication.
### 1.4 Address Resolution Protocol (ARP)
ARP (Address Resolution Protocol) is a protocol used within a local network to map known network addresses (like IP addresses) to the link-layer addresses (MAC addresses) of terminals. ARP operates at the boundary between the network layer and the data link layer [2](#page=2).
---
# Network protocols and internetworking
This section details the fundamental role of network protocols in enabling host-to-host data transmission across diverse networks and elucidates the concept of internetworking.
### 2.1 The purpose and necessity of network protocols
The primary purpose of a network protocol is to ensure that data packets can be transmitted from one host to another, even when these hosts are connected through multiple interconnected networks. This is crucial for the scalability and interoperability of global networks. Without standardized protocols, every data network would be forced to use the same link-layer protocol and addressing scheme, similar to the early ARPANET. Protocols provide the common rules and conventions necessary for devices to communicate effectively across different network technologies and physical infrastructures [2](#page=2).
### 2.2 Internetworking: Connecting diverse networks
Internetworking refers to the capability of data to be transmitted across various networks that may not utilize the same underlying protocols. For internetworking to be successful, all participating networks must adhere to common rules for addressing and data forwarding. This requires a shared network protocol that all these diverse networks can understand and implement. Special network equipment, known as routers, is essential for directing data between these different networks. The global Internet is a prime example of a vast internetworked system [2](#page=2).
### 2.3 Key protocols and their functions
Several protocols play critical roles in enabling internetworking and host-to-host communication.
#### 2.3.1 Address Resolution Protocol (ARP)
ARP is a protocol used within a local network to map known network addresses, specifically IP addresses, to the link-layer addresses (MAC addresses) of terminals. ARP operates at a layer between the network layer and the link layer [2](#page=2).
> **Example:** When your computer wants to send data to another device on the same local network, it knows the destination IP address but needs the MAC address to actually send the frame. ARP helps resolve this by broadcasting a request for the MAC address associated with that IP address.
#### 2.3.2 Internet Control Message Protocol (ICMP)
ICMP serves as a helper protocol to IP. It facilitates various queries at the IP level. A common use is for echo requests and replies, which are the foundation of the `ping` utility. ICMP is also used for error reporting when an IP packet cannot be delivered successfully. For instance, the "Time Exceeded" message is sent if an IP packet has undergone too many router hops, indicating a potential routing loop or excessive delay. This is utilized by tools like `traceroute` [3](#page=3).
> **Tip:** Think of ICMP as the "status report" protocol for IP. It doesn't carry user data itself but provides essential feedback and control information about IP packet delivery.
#### 2.3.3 Dynamic Host Configuration Protocol (DHCP)
DHCP is utilized in local networks to automatically assign dynamic IP addresses and distribute other vital network information. This can include IP addresses for the default gateway and DNS servers. When a terminal connects to a local network, it broadcasts a DHCP request. A DHCP server, often integrated into the default gateway, then responds with the requested network configuration details [3](#page=3).
> **Example:** When you connect your laptop to a Wi-Fi network, DHCP is likely responsible for giving your laptop an IP address, a subnet mask, a default gateway address, and the addresses of DNS servers, allowing you to access the internet without manual configuration.
### 2.4 The role of different addresses in internet communication
To access resources like a web page on the internet, a computer requires multiple types of addresses, each serving a distinct purpose at different protocol layers [3](#page=3).
* **MAC Address:** This address belongs to the link layer and identifies your device's specific location within the local network. It is crucial for delivering data frames within the same physical network segment [3](#page=3).
* **IP Address:** This address resides at the network layer and represents your device's unique identity on the global Internet. IP addresses are essential for routing IP packets across different networks to reach their final destination [3](#page=3).
* **Port Address:** This address belongs to the transport layer and specifies which application process on the destination host should receive the IP packets. For example, when browsing the web using HTTP, port addresses ensure that incoming packets are directed to the correct web browser application [3](#page=3).
> **Tip:** Understanding the hierarchy of these addresses (MAC for local delivery, IP for global routing, and Port for application selection) is fundamental to grasping how data travels across the internet.
### 2.5 Transport layer function
The transport layer, as defined in the OSI model, is responsible for transferring data between two application processes. This layer ensures reliable and efficient end-to-end communication, often handling tasks like segmentation, reassembly, flow control, and error correction, depending on the specific transport protocol used (e.g., TCP or UDP) [3](#page=3).
---
# Network addressing and protocols
This section details the fundamental protocols and addressing schemes essential for network communication, focusing on how devices identify and interact with each other across networks.
### 3.1 Network protocols: purpose and internetworking
A network protocol serves to ensure that data packets can be transmitted from one host to another across multiple networks. This is crucial for enabling interoperability, preventing all networks from being forced to use the same link-layer protocol and, consequently, the same link-level addressing system, as was the case with early networks like ARPANET [2](#page=2).
Internetworking, the foundational concept of the Internet, refers to the ability to send data across diverse networks that may not share the same underlying protocols. For this to be possible, all interconnected networks must adhere to common rules for addressing and data forwarding, necessitating a universal network protocol. Network equipment capable of facilitating communication between different networks, known as routers, are essential for this process on the Internet [2](#page=2).
### 3.2 Key network protocols and their functions
#### 3.2.1 Address Resolution Protocol (ARP)
ARP is a protocol used within a local network to map known network addresses (IP addresses) to the link-layer addresses (MAC addresses) of terminals. It operates between the network layer and the link layer [2](#page=2).
#### 3.2.2 Internet Control Message Protocol (ICMP)
ICMP is a supplementary protocol to IP, used for sending various queries at the IP level. A common example is the echo-request and reply used by the `ping` utility. ICMP is also utilized for error reporting when an IP packet fails to reach its destination, such as the "Time Exceeded" message sent when a packet has undergone too many router hops. This is leveraged by tools like `traceroute` [3](#page=3).
#### 3.2.3 Dynamic Host Configuration Protocol (DHCP)
DHCP is employed in local networks to dynamically assign IP addresses and other network configuration information, such as the IP addresses for the Default Gateway and DNS servers. When a device connects to a local network, it broadcasts a DHCP request. A DHCP server, typically the Default Gateway, then responds with the requested information [3](#page=3).
#### 3.2.4 Transport Layer Protocols (TCP and UDP)
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are both transport layer protocols for the Internet. They operate at the transport layer (layer 4) of the OSI model [4](#page=4).
#### 3.2.5 Internet Protocol (IP)
IP is the network protocol for the Internet, operating at the network layer (layer 3) of the OSI model [4](#page=4).
### 3.3 The role of different addresses in network communication
For a device to access a web page when connected to an Ethernet and surfing the Internet, it requires three distinct addresses, each belonging to a different protocol layer [3](#page=3).
* **MAC Address:** Belongs to the link layer and identifies the device's address within the local network. Ethernet is an example of a standard specifying protocols for the physical and link layers [3](#page=3) [4](#page=4).
* **IP Address:** Belongs to the network layer and specifies the device's address on the global Internet, ensuring IP packets take the correct route. IP addresses are classified into different classes, and their structure is fundamental to network routing [3](#page=3) [4](#page=4).
* **Port Address:** Belongs to the transport layer and indicates which application the IP packets are intended for. For instance, when requesting a web page using HTTP, packets must be delivered to the specific web browser application [3](#page=3).
### 3.4 IP address classification and structure
IP addresses are fundamental identifiers in network communication. They are often discussed in terms of their classes, which dictate the division between the network ID and the host ID.
#### 3.4.1 IPv4 address classes
The class of an IPv4 address is determined by the range of its first octet [5](#page=5).
| Class | First octet range |
| :---- | :---------------- |
| A | 0-127 |
| B | 128-191 |
| C | 192-223 |
| D | 224-239 |
| E | 240-255 |
**Example:**
* `208.34.54.12` falls into Class C [5](#page=5).
* `238.34.2.1` falls into Class D [5](#page=5).
* `114.34.2.8` falls into Class A [5](#page=5).
* `129.14.6.8` falls into Class B [5](#page=5).
* `241.34.2.8` falls into Class E [5](#page=5).
#### 3.4.2 Network ID and Host ID in classful addressing
In classful IP addressing, the network ID and host ID are determined by the address class.
* **Class A:** The first 8 bits identify the network ID, and the remaining 24 bits identify the host ID [6](#page=6).
* **Example:** For `114.34.2.8`, Net ID is `114.0.0.0` and Host ID is `0.34.2.8` [6](#page=6).
* **Class B:** The first 16 bits identify the network ID, and the remaining 16 bits identify the host ID [6](#page=6).
* **Example:** For `171.34.14.8`, Net ID is `171.34.0.0` and Host ID is `0.0.14.8` [6](#page=6).
* **Class C:** The first 24 bits identify the network ID, and the remaining 8 bits identify the host ID [6](#page=6).
* **Example:** For `192.8.56.2`, Net ID is `192.8.56.0` and Host ID is `0.0.0.2` [6](#page=6).
#### 3.4.3 Network ID and Host ID in classless addressing (CIDR)
Classless Inter-Domain Routing (CIDR) allows for more flexible IP address allocation, using a subnet mask to define the network and host portions. The mask is often represented in `/n` format, where `n` is the number of bits in the network portion of the address [4](#page=4) [8](#page=8).
* **Example:** An IP address `130.235.185.49` with a mask `255.255.0.0` has a Net ID of `130.235.0.0` and a Host ID of `0.0.185.49` [7](#page=7).
* **Example:** For IP address `130.235.188.247` and mask `255.255.192.0`:
* The Net ID is `130.235.128.0` [7](#page=7).
* The Host ID is `0.0.60.247` [7](#page=7).
* When working with classless addresses, focus on the 2-byte segments where the mask is greater than one and less than 255 [7](#page=7).
* **Example:** For IP address `120.14.22.16` and mask `255.255.128.0`:
* Net ID: `120.14.0.0`
* Host ID: `0.0.22.16` [7](#page=7).
* **Example:** For IP address `141.181.14.16` and mask `255.255.224.0`:
* Net ID: `141.181.0.0`
* Host ID: `0.0.14.16` [7](#page=7).
#### 3.4.4 IPv4 mask notation (/n format)
The `/n` notation represents the length of the subnet mask in bits [8](#page=8).
* `255.255.255.0` corresponds to `/24` (24 bits) [8](#page=8).
* `255.0.0.0` corresponds to `/8` (8 bits) [8](#page=8).
* `255.255.224.0` corresponds to `/19` (19 bits) [8](#page=8).
* `255.255.240.0` corresponds to `/20` (20 bits) [8](#page=8).
#### 3.4.5 Calculating the number of IPv4 addresses in an address block
The number of IPv4 addresses in an address block is determined by the prefix length. The formula is $2^{(32-n)}$, where $n$ is the prefix length.
* **Example:** For `200.17.21.128/27`, the number of addresses is $2^{(32-27)} = 2^5 = 32$ [8](#page=8).
* **Example:** For `17.34.16.0/23`, the number of addresses is $2^{(32-23)} = 2^9 = 512$ [8](#page=8).
* **Example:** For `180.34.64.64/30`, the number of addresses is $2^{(32-30)} = 2^2 = 4$ [8](#page=8).
* **Example:** For `123.56.77.55/29`, the number of addresses is $2^{(32-29)} = 2^3 = 8$ [8](#page=8).
### 3.5 OSI model layer mapping for network concepts
Different network concepts and protocols are associated with specific layers of the OSI model.
* **Physical Layer (Layer 1):** Manchester encoding (method for sending digital data as signals) Noise (disturbance on the transmission medium) [4](#page=4).
* **Link Layer (Layer 2):** CSMA/CD (medium access control method) 802.3 (standard for local networks, Ethernet, specifying protocols for physical and link layers) [4](#page=4).
* **Network Layer (Layer 3):** IP (network protocol for the Internet) ICMP (helper protocol for the Internet, providing error information and queries) Router (path selector that handles network addresses) CIDR (concept for classless IP address allocation) [4](#page=4).
* **Transport Layer (Layer 4):** Port address (address used by the transport protocol to direct data to the correct application) TCP, UDP (transport protocols for the Internet) [4](#page=4).
* **Application Layer (Layer 7):** Port address (also considered here as it directs data to a specific application) URL (addressing within the WWW application) DNS (application protocol for mapping hostnames to IP addresses) HTTP (application protocol for the Internet) [4](#page=4).
* **ARP:** Operates between Layer 2 and Layer 3 (Link and Network) [4](#page=4).
> **Tip:** Understanding how these protocols and concepts map to the OSI model is crucial for troubleshooting and designing networks. Remember that some concepts can have relevance across multiple layers.
---
# OSI layer assignments and IPv6 addressing
This section details the mapping of networking concepts to the OSI model and explores the simplification rules for representing IPv6 addresses.
### 4.1 OSI layer assignments
The OSI model is a conceptual framework used to understand and standardize the functions of a telecommunication or computing system in terms of abstraction layers. Different networking protocols and concepts are assigned to specific layers based on their function.
#### 4.1.1 Physical layer (Layer 1)
The physical layer deals with the physical connection between devices and the transmission of raw bit streams.
* **Manchester encoding**: This is a method for sending digital data as signals, making it a physical layer concept [4](#page=4).
* **Noise**: This refers to disturbances that can occur on transmission media, impacting the physical transmission of signals [4](#page=4).
#### 4.1.2 Data link layer (Layer 2)
The data link layer provides reliable transit of data across a physical link. It handles error detection and correction on the physical link.
* **CSMA/CD (Carrier Sense Multiple Access with Collision Detection)**: This is a media access control method used in Ethernet networks [4](#page=4).
* **802.3**: This is a standard for local area networks, specifically Ethernet, which specifies protocols for both the physical and data link layers [4](#page=4).
* **ARP (Address Resolution Protocol)**: This protocol operates between the data link and network layers. It is used to find the MAC address of a node on a local network when its IP address is known [4](#page=4).
#### 4.1.3 Network layer (Layer 3)
The network layer is responsible for logical addressing and routing of packets across networks.
* **Router**: A router is a device that operates at the network layer, acting as a traffic director that handles network addresses [4](#page=4).
* **CIDR (Classless Inter-Domain Routing)**: This is a concept used for the classless addressing of IP addresses [4](#page=4).
* **IP (Internet Protocol)**: This is the network protocol for the Internet, responsible for addressing and routing packets [4](#page=4).
* **ICMP (Internet Control Message Protocol)**: This is a helper protocol for the Internet that informs the recipient if something has gone wrong and allows for requests [4](#page=4).
#### 4.1.4 Transport layer (Layer 4)
The transport layer provides reliable or unreliable data transfer services to higher-level protocols.
* **Port address**: A port address is used by transport protocols to direct data to the correct application on a host. It can be considered a transport layer concept (Layer 4) and sometimes an application layer concept (Layer 7) [4](#page=4).
* **TCP (Transmission Control Protocol)** and **UDP (User Datagram Protocol)**: These are two transport protocols used for the Internet [4](#page=4).
#### 4.1.5 Application layer (Layer 7)
The application layer provides network services directly to end-user applications.
* **URL (Uniform Resource Locator)**: A URL is an address used within an application, specifically the World Wide Web [4](#page=4).
* **DNS (Domain Name System)**: DNS is an application protocol used to map symbolic hostnames (e.g., www.lth.se) to IP addresses [4](#page=4).
* **HTTP (Hypertext Transfer Protocol)**: This is an application protocol for the Internet [4](#page=4).
### 4.2 IPv6 address simplification
IPv6 addresses are 128 bits long and are typically written as eight groups of four hexadecimal digits, separated by colons. Several rules are applied to shorten these addresses for easier representation.
#### 4.2.1 Rule 1: Omit leading zeros in a group
Leading zeros in any group of four hexadecimal digits can be omitted. For example, `00AA` can be written as `AA`, and `0001` can be written as `1` [10](#page=10) [9](#page=9).
#### 4.2.2 Rule 2: Compress consecutive groups of zeros
One or more consecutive groups of zeros can be replaced by a double colon (`::`). This substitution can only be done once per IPv6 address [10](#page=10) [9](#page=9).
> **Tip:** The `::` can only appear once in an IPv6 address because if it appeared more than once, it would be ambiguous as to how many groups of zeros each `::` represented.
#### 4.2.3 Examples of IPv6 address simplification
* **Address:** `2340:1ABC:119A:A000:0000:0000:0000:0001`
* Applying Rule 1: No leading zeros to omit in the first four groups. `A000` remains `A000`.
* Applying Rule 2: The four consecutive groups of zeros (`0000:0000:0000:0000`) can be replaced by `::`.
* **Shortest form:** `2340:1ABC:119A:A000::1` [9](#page=9).
* **Address:** `0000:00AA:0000:0000:0000:0000:119A:A231`
* Applying Rule 1: `0000` becomes `0`, `00AA` becomes `AA`, `119A` remains `119A`, `A231` remains `A231`.
* Applying Rule 2: The five consecutive groups of zeros (`0:0:0:0:0`) can be replaced by `::`.
* **Shortest form:** `0:AA::119A:A231` [9](#page=9).
* **Address:** `2340:0000:0000:0000:0000:119A:A001:0000`
* Applying Rule 1: `0000` becomes `0`, `119A` remains `119A`, `A001` remains `A001`.
* Applying Rule 2: The four consecutive groups of zeros (`0:0:0:0`) can be replaced by `::`.
* **Shortest form:** `2340::119A:A001:0` [10](#page=10).
* **Address:** `0000:0000:8000:2340:0000:0000:0000:0000`
* Applying Rule 1: `0000` becomes `0`, `8000` remains `8000`, `2340` remains `2340`.
* Applying Rule 2: The four consecutive groups of zeros (`0:0:0:0`) can be replaced by `::`.
* **Shortest form:** `0:0:8000:2340::` [10](#page=10).
#### 4.2.4 Examples of IPv6 address expansion
To expand a compressed IPv6 address to its full form, reverse the simplification rules.
* **Address:** `0::0`
* The `::` indicates a sequence of zero groups. Since the address has two parts (`0` and `0`), and there are eight groups in total, the `::` must represent six groups of zeros.
* **Original form:** `0000:0000:0000:0000:0000:0000:0000:0000` [10](#page=10).
* **Address:** `0:AA::0`
* The `::` represents a sequence of zero groups. We have `0` and `AA` at the beginning, and `0` at the end. This implies the `::` must represent five groups of zeros to make up the total of eight groups.
* **Original form:** `0000:00AA:0000:0000:0000:0000:0000:0000` [10](#page=10).
* **Address:** `0:1234::3`
* The `::` represents a sequence of zero groups. We have `0`, `1234`, and `3`. The `::` must represent six groups of zeros.
* **Original form:** `0000:1234:0000:0000:0000:0000:0000:0003` [10](#page=10).
* **Address:** `123::1:2`
* The `::` represents a sequence of zero groups. We have `123`, `1`, and `2`. The `::` must represent five groups of zeros.
* **Original form:** `0123:0000:0000:0000:0000:0000:0001:0002` [10](#page=10).
---
# TCP session management and file transfer efficiency
This topic delves into the mechanics of TCP session management, focusing on sender windows and acknowledgments, and quantifies the time and efficiency of large file transfers over Ethernet using TCP/IPv6.
### 5.1 TCP session management with acknowledgments
TCP utilizes cumulative acknowledgments to ensure reliable data transmission. An acknowledgment (ACK) message from the receiver informs the sender about the next sequence byte it expects. This mechanism is crucial for tracking the progress of data segments and managing the sender's window [12](#page=12).
#### 5.1.1 Sender window dynamics
The sender's window represents the amount of unacknowledged data that can be in transit. When the sender receives an ACK, it indicates that the data up to the acknowledged sequence number has been successfully received. The sender then advances its window, allowing it to send new data [12](#page=12).
> **Example:**
> Suppose a TCP session has a sender window of 10,000 bytes, and the last acknowledged byte number is 22,001. If the sender then receives an ACK for byte 24,001, it means data up to byte 24,000 has been received. The sender's window will shift forward, and it can now send data starting from byte 24,001. If the sender then sends two segments of 1,500 bytes each, the window will be updated accordingly after these transmissions and subsequent acknowledgments [12](#page=12).
The diagram illustrating the sender's window would show its progression based on received ACKs and transmitted data segments. The "Before" state would show the window up to byte 22,000, and the "After" state would reflect the window advancement due to the ACK for 24,001. Further transmissions would adjust the window's boundaries [12](#page=12).
### 5.2 File transfer efficiency over Ethernet using TCP/IPv6
Analyzing the efficiency of large file transfers involves calculating the time taken and the percentage of useful data transmitted over the network link.
#### 5.2.1 Calculating file transfer time
To determine the transmission time, several factors are considered: the file size, the Maximum Segment Size (MSS) for TCP, and the network link's capacity.
* **File Size:** The total amount of data to be transferred. For example, a 5 GB file is equivalent to $5 \cdot 10^9$ bytes [13](#page=13).
* **Number of Segments:** This is calculated by dividing the total file size by the TCP MSS.
$N_S = \frac{\text{File Size}}{\text{MSS}}$ [13](#page=13).
For a file size of 5 GB and an MSS of 1,460 bytes:
$N_S = \frac{5 \cdot 10^9 \text{ bytes}}{1,460 \text{ bytes}} \approx 3,424,658 \text{ segments}$ [13](#page=13).
* **Frame Size:** Each TCP segment is encapsulated within IP (IPv6) and Ethernet headers. The total size of each frame is the sum of the TCP header, IPv6 header, and Ethernet header, plus the TCP MSS. Standard header sizes are: TCP (20 bytes), IPv6 (40 bytes), and Ethernet (18 bytes), totaling 78 bytes [13](#page=13).
$S_F = \text{MSS} + \text{TCP Header} + \text{IPv6 Header} + \text{Ethernet Header}$ [13](#page=13).
$S_F = 1,460 \text{ bytes} + 78 \text{ bytes} = 1,538 \text{ bytes}$ [13](#page=13).
* **Total Data Sent:** The total amount of data transmitted, including headers, is the frame size multiplied by the number of segments.
Total Data Sent = $S_F \cdot N_S$ [13](#page=13).
Total Data Sent $\approx 1,538 \text{ bytes} \cdot 3,424,658 \approx 5,267,124,004 \text{ bytes} \approx 5.27 \text{ GB}$ [13](#page=13).
* **Transmission Time:** This is the total data sent divided by the link capacity. For a 100 Mbps Ethernet link:
$T_T = \frac{\text{Total Data Sent} \cdot 8 \text{ bits/byte}}{\text{Link Capacity}}$ [13](#page=13).
$T_T = \frac{5,267,124,004 \text{ bytes} \cdot 8 \text{ bits/byte}}{100,000,000 \text{ bits/s}} \approx 421.37 \text{ seconds}$ [13](#page=13).
This translates to approximately 7 minutes for the file transfer [13](#page=13).
#### 5.2.2 Calculating overall transfer efficiency
The efficiency of the entire transfer is defined as the ratio of useful data (payload) to the total data transmitted (payload plus headers).
Efficiency = $\frac{\text{Useful Data}}{\text{Total Data}}$ [13](#page=13).
Efficiency = $\frac{\text{MSS}}{\text{Frame Size}}$ [13](#page=13).
Efficiency = $\frac{1,460 \text{ bytes}}{1,538 \text{ bytes}} \approx 0.9493$ [13](#page=13).
Therefore, the overall transfer efficiency is approximately 94.93%. This calculation assumes no overhead from error handling, congestion control, or flow control mechanisms [12](#page=12) [13](#page=13).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| OSI model | A conceptual framework that standardizes the functions of a telecommunication or computing system in terms of abstraction layers. It is divided into seven layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application. |
| TCP/IP model | A conceptual framework that standardizes the functions of a telecommunication or computing system. It is often described as having four layers: Network Interface, Internet, Transport, and Application. |
| Network protocol | A set of rules that governs how data is transmitted and received between devices in a network. These rules ensure interoperability and proper communication flow. |
| Internetworking | The process of connecting multiple distinct computer networks to allow them to function as a single, larger network. This involves using common protocols and routing mechanisms. |
| ARP (Address Resolution Protocol) | A network protocol used to discover the hardware address (MAC address) of a network node, typically in a local area network (LAN), when only its IP address is known. |
| MAC address | A unique identifier assigned to a network interface controller (NIC) for communications at the data link layer of a network segment. It is a physical address burned into the hardware. |
| IP address | A numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. It serves as an identifier for both the host and the network. |
| ICMP (Internet Control Message Protocol) | A network layer protocol used by network devices, like routers, to send error messages and operational information. It is often used by diagnostic tools like ping and traceroute. |
| DHCP (Dynamic Host Configuration Protocol) | A network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other network configuration parameters to devices. |
| Transport layer | In the OSI model, this layer is responsible for providing reliable end-to-end data transfer between applications running on different hosts. TCP and UDP operate at this layer. |
| Port address | A numerical value that identifies a specific application or process on a network device. It is used by the transport layer to direct incoming data to the correct application. |
| Router | A networking device that forwards data packets between computer networks. Routers perform the traffic-directing functions on the Internet. |
| CSMA/CD (Carrier Sense Multiple Access with Collision Detection) | A media access control method used by networked Ethernet technology to share a single communication channel. It detects when two or more devices attempt to transmit at the same time. |
| CIDR (Classless Inter-Domain Routing) | A method for allocating IP addresses and routing IP packets more efficiently. It is a way of defining network prefixes without regard to the traditional classful addressing system. |
| DNS (Domain Name System) | A hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It translates human-readable domain names into machine-readable IP addresses. |
| HTTP (Hypertext Transfer Protocol) | An application protocol for distributed, hypermedia information systems. It is the foundation of data communication for the World Wide Web. |
| TCP (Transmission Control Protocol) | A core protocol of the Internet protocol suite. It provides reliable, ordered, and error-checked delivery of a stream of bytes between applications running on hosts communicating via an IP network. |
| UDP (User Datagram Protocol) | A communication protocol used across the Internet for time-sensitive transmissions such as video playback or DNS lookups. It provides a connectionless communication service. |
| IPv4 | The fourth version of the Internet Protocol, which provides a unique numerical address to every device connected to the Internet. It uses a 32-bit address system. |
| IPv6 | The successor to IPv4, designed to provide a vastly larger address space and other improvements. It uses a 128-bit address system. |
| Net ID | The portion of an IP address that identifies the specific network to which a device is connected. |
| Host ID | The portion of an IP address that uniquely identifies a specific device (host) within a network. |
| Broadcast address | A special IP address used to send data packets to all devices on a network segment simultaneously. |
| MSS (Maximum Segment Size) | The largest amount of data, specified in bytes, that TCP will put into a single segment. It is typically derived from the network's MTU. |
| Sender window | A mechanism in TCP that limits the amount of unacknowledged data a sender can transmit at any given time, helping to manage network congestion and ensure reliable delivery. |
| ACK number (Acknowledgement number) | A field in a TCP segment that indicates the sequence number of the next byte the sender of the ACK expects to receive. It implies that all prior bytes have been successfully received. |
| MTU (Maximum Transmission Unit) | The largest size, in bytes, of a single data packet that can be transmitted over a particular network link. |
| Ethernet frame | A data packet formatted according to the Ethernet protocol, used for transmission over an Ethernet network. It includes headers and trailers for addressing and error checking. |
Cover
EITF45 övning 3 (FL6) Networking uppgifter med lösningar.pdf
Summary
# Network communication analysis and message tracing
This topic focuses on understanding how data travels across networks by analyzing the different types of messages exchanged, including their MAC and IP addresses, and how they are processed by various network devices [2](#page=2).
### 1.1 Message types and their roles
Network communication involves various types of messages, each serving a specific purpose. Understanding these messages is crucial for tracing communication flows and diagnosing network issues.
#### 1.1.1 ARP (Address Resolution Protocol)
ARP is used to discover the MAC address associated with a known IP address on the local network segment [5](#page=5) [8](#page=8).
* **ARP Request:** When a host needs to send a packet to an IP address on the same network segment but doesn't know the corresponding MAC address, it broadcasts an ARP request. This request contains the sender's MAC and IP addresses, and the target IP address. The MAC address destination is a broadcast address (FF:FF:FF:FF:FF:FF) as it's sent to all devices on the local network [3](#page=3) [5](#page=5) [8](#page=8).
* **ARP Reply:** The host with the matching IP address responds with an ARP reply, containing its MAC and IP addresses, to the original sender [5](#page=5) [8](#page=8).
ARP messages are Ethernet frames and do not typically have an IP header, although IP addresses are included in the ARP header [5](#page=5) [8](#page=8).
#### 1.1.2 DNS (Domain Name System)
DNS is responsible for translating symbolic hostnames (like "www.d.se") into IP addresses [2](#page=2) [3](#page=3) [8](#page=8).
* **DNS Request:** A host sends a DNS request to a DNS server to resolve a hostname. This request includes the sender's IP and MAC addresses, and the destination IP and MAC addresses of the DNS server [3](#page=3) [8](#page=8).
* **DNS Reply:** The DNS server responds with the IP address corresponding to the requested hostname, including sender and receiver IP and MAC addresses [3](#page=3) [8](#page=8).
#### 1.1.3 ICMP (Internet Control Message Protocol)
ICMP is used for error reporting and network diagnostics.
* **ICMP Echo Request (Ping):** A common use of ICMP is the echo request, used for pinging a host to check its reachability and response time. A host sends an ICMP Echo Request to the destination IP address and the MAC address of its default gateway (or directly if on the same network) [2](#page=2) [3](#page=3) [8](#page=8).
* **ICMP Echo Reply:** The destination host sends an ICMP Echo Reply back to the source [2](#page=2) [3](#page=3).
* **ICMP Redirect:** Historically, a router might send an ICMP redirect message to a host to inform it that a more efficient path exists for subsequent traffic to a particular destination [2](#page=2).
#### 1.1.4 HTTP (Hypertext Transfer Protocol)
HTTP is the foundation of data communication for the World Wide Web, used for fetching web pages and resources [10](#page=10) [4](#page=4) [5](#page=5) [8](#page=8).
* **HTTP Request:** When a client requests a web page, it sends an HTTP request. This request includes the client's IP and MAC addresses, and the destination IP and MAC addresses of the web server. The communication often involves routing through intermediate devices like routers [10](#page=10) [5](#page=5) [8](#page=8).
### 1.2 Message tracing in different network scenarios
Analyzing network communication requires understanding how different network devices handle messages.
#### 1.2.1 Hosts, Routers, Switches, and Hubs
The behavior of network devices significantly impacts how messages are propagated and observed.
* **Hub:** A hub operates at the physical layer and simply repeats any incoming signal to all its other ports. This means any traffic on a hub is visible to all connected devices, creating a single collision domain. ARP requests and replies, as well as IP packets, broadcasted by or destined for any host connected to the hub will be seen by other connected hosts [4](#page=4) [5](#page=5) [6](#page=6) [7](#page=7).
* **Switch:** A switch operates at the data link layer and learns MAC addresses associated with its ports. It forwards frames only to the specific port where the destination MAC address is located. Switches segment networks into smaller collision domains. If A sends an IP packet to C, and Gizmo is a switch, nothing will be seen on B's link if A and C are on the same network segment and the switch has learned C's MAC address [4](#page=4) [5](#page=5).
* **Router:** A router operates at the network layer and connects different IP networks. It forwards IP packets based on destination IP addresses and routing tables. When a host sends an IP packet to a destination on a different network, it sends the packet to its default gateway (router). Routers create separate broadcast domains. If Gizmo is a router, and A wants to send to C (on a different network), A will send the packet to the router, and nothing will be seen on B's link if B is not directly connected to A's network segment [2](#page=2) [4](#page=4) [5](#page=5).
#### 1.2.2 Scenarios and Message Flows
**Scenario 1: Host A pings Host D (known by symbolic address)**
When host A wants to ping host D, and only knows D by its symbolic address "www.d.se", several steps are involved, assuming empty caches [2](#page=2):
1. **ARP Request for DNS Server:** Host A needs to resolve the IP address of "www.d.se". First, it needs the MAC address of its default gateway (R1). It sends an ARP request to find the MAC address of the DNS server. This request is broadcasted [2](#page=2) [3](#page=3).
2. **ARP Reply from DNS Server:** The DNS server replies with its MAC address [3](#page=3).
3. **DNS Request:** Host A sends a DNS request to the DNS server to resolve "www.d.se" [2](#page=2) [3](#page=3).
4. **DNS Reply:** The DNS server replies with the IP address of "www.d.se" [2](#page=2) [3](#page=3).
5. **ARP Request for R1:** Now that A knows the IP address of R1 (its default gateway), it sends an ARP request to find R1's MAC address. This is broadcasted to discover R1's MAC address if it's on the same local network [3](#page=3).
6. **ARP Reply from R1:** R1 replies with its MAC address [3](#page=3).
7. **ICMP Echo Request to R1:** Host A sends the ICMP Echo Request to the IP address of D, but with R1's MAC address as the Layer 2 destination, as R1 is the default gateway [2](#page=2) [3](#page=3).
8. **R1 forwards ICMP Echo Request:** R1, upon receiving the packet, consults its routing table. It identifies that D is reachable via R2. R1 then forwards the ICMP Echo Request towards R2. If R2 is not on the same local network as R1, R1 will perform an ARP request to find R2's MAC address [3](#page=3).
9. **ICMP Echo Reply from D:** Host D receives the ICMP Echo Request and sends an ICMP Echo Reply back. This reply will traverse back through R2 and R1 to reach A [2](#page=2) [3](#page=3).
**Scenario 2: Host B pings Host D (known by symbolic address)**
This scenario is similar to scenario 1, but focuses on the messages seen by B, and highlights ARP broadcasts [2](#page=2) [3](#page=3).
* **ARP Request for DNS Server:** Host B broadcasts an ARP request for the DNS server's MAC address [3](#page=3).
* **ARP Request for R1:** Host B broadcasts an ARP request for R1's MAC address [3](#page=3).
* **ARP Request for R2:** R1 might broadcast an ARP request for R2's MAC address if it needs to communicate with R2 and its ARP cache is empty [3](#page=3).
**Scenario 3: Host A sends an IP packet to Host C (with updated caches)**
If the network has been running and caches are updated, A already knows C's MAC address (if they are on the same network) [4](#page=4).
* **Hub:** If Gizmo is a hub, A sends an IP packet with C's IP and MAC address. The hub broadcasts this packet to all ports, including B's link [4](#page=4).
* **Switch:** If Gizmo is a switch, A sends an IP packet with C's IP and MAC address. The switch forwards this packet only to the port connected to C, so nothing appears on B's link [4](#page=4).
* **Router:** If Gizmo is a router, A sends an IP packet with C's IP address. However, the Layer 2 destination MAC address will be the router's MAC address, as C is on a different network. Nothing appears on B's link [4](#page=4).
**Scenario 4: Host A sends an IP packet to Host C (with empty caches)**
With empty caches, A needs to discover C's MAC address [4](#page=4) [5](#page=5).
* **Hub:** A sends an ARP request for C's MAC address, which is broadcast and seen on B's link. C's ARP reply is also broadcast and seen on B's link. Finally, A's IP packet to C is sent [5](#page=5).
* **Switch:** A sends an ARP request for C's MAC address, which is broadcast. The switch learns C's MAC address from C's ARP reply and forwards it accordingly. Only the ARP request is seen on B's link [5](#page=5).
* **Router:** A sends an ARP request for the router's MAC address, then sends the IP packet to the router. Nothing is seen on B's link [5](#page=5).
**Scenario 5: Host A wants to fetch a webpage from "WWW" (Gizmo is a switch, empty caches)**
This scenario involves a sequence of ARP, DNS, and HTTP requests [5](#page=5).
1. **ARP Request (A to Router):** A needs to send to the router. It broadcasts an ARP request for the router's MAC address [5](#page=5).
2. **ARP Reply (Router to A):** The router replies with its MAC address [5](#page=5).
3. **DNS Request (A to Router to DNS):** A needs the IP address of "WWW". It sends a DNS request to its router, which forwards it to the DNS server [5](#page=5).
4. **ARP Request (Router to DNS):** The router needs the MAC address of the DNS server to forward the request. It broadcasts an ARP request [5](#page=5).
5. **ARP Reply (DNS to Router):** The DNS server replies with its MAC address [5](#page=5).
6. **DNS Request (Router to DNS):** The router forwards the DNS request to the DNS server [5](#page=5).
7. **DNS Reply (DNS to Router to A):** The DNS server replies with the IP address of "WWW", sent back to the router and then to A [5](#page=5).
8. **HTTP Request (A to Router to WWW):** A sends an HTTP request for "www.mypage.se/minsida.html" to its router, destined for the IP address of WWW [5](#page=5).
9. **ARP Request (Router to WWW):** The router needs the MAC address of WWW. It broadcasts an ARP request to find it [5](#page=5).
10. **ARP Reply (WWW to Router):** WWW replies with its MAC address [5](#page=5).
11. **HTTP Request (Router to WWW):** The router forwards the HTTP request to WWW [5](#page=5).
**Scenario 6: Host B sends an IP packet to DNS Server (empty caches)**
This scenario illustrates communication within a network segment and across subnets [7](#page=7) [8](#page=8).
1. **ARP request (B to Router A):** Host B needs to send to the DNS server, which is on a different subnet. B first sends an ARP request for its default gateway, Router A [7](#page=7) [8](#page=8).
2. **ARP reply (Router A to B):** Router A replies with its MAC address [7](#page=7) [8](#page=8).
3. **DNS request (B to Router A to DNS):** B sends a DNS request to Router A, which forwards it towards the DNS server [7](#page=7) [8](#page=8).
4. **ARP request (Router A to DNS):** Router A needs the MAC address of the DNS server to forward the request. It sends an ARP request on the DNS server's subnet [7](#page=7) [8](#page=8).
5. **ARP reply (DNS to Router A):** The DNS server replies with its MAC address [7](#page=7) [8](#page=8).
6. **DNS request (Router A to DNS):** Router A forwards the DNS request to the DNS server [7](#page=7) [8](#page=8).
7. **DNS Reply (DNS to Router A to B):** The DNS server replies to Router A, which then forwards the reply to B [7](#page=7) [8](#page=8).
**Scenario 7: Host A fetches a webpage from the webserver (empty caches)**
This detailed scenario shows the interaction of ARP, DNS, and HTTP requests when accessing a web server from a different subnet [7](#page=7) [8](#page=8).
1. **ARP request (A to Router A):** Host A needs to access the web server, which is on a different subnet. A first sends an ARP request for its default gateway, Router A [7](#page=7) [8](#page=8).
2. **ARP reply (Router A to A):** Router A replies with its MAC address [7](#page=7) [8](#page=8).
3. **DNS request (A to Router A to DNS):** A needs the IP address of the web server. It sends a DNS request to Router A, which forwards it to the DNS server [7](#page=7) [8](#page=8).
4. **ARP request (Router A to DNS):** Router A needs the MAC address of the DNS server. It sends an ARP request on the DNS server's subnet [7](#page=7) [8](#page=8).
5. **ARP reply (DNS to Router A):** The DNS server replies with its MAC address [7](#page=7) [8](#page=8).
6. **DNS request (Router A to DNS):** Router A forwards the DNS request to the DNS server [7](#page=7) [8](#page=8).
7. **DNS Reply (DNS to Router A to A):** The DNS server replies with the web server's IP address to Router A, which then forwards it to A [7](#page=7) [8](#page=8).
8. **ARP request (A to Router B):** A now needs to send an HTTP request to the web server's IP. Since the web server is on a different subnet from A, A sends the packet to its default gateway (Router A). However, if Router A has multiple interfaces and the web server is reachable through Router B, A might be directed to Router B. This example shows A sending an ARP request for Router B's MAC address [7](#page=7) [8](#page=8).
9. **ARP reply (Router B to A):** Router B replies with its MAC address [7](#page=7) [8](#page=8).
10. **HTTP request (A to Router B to WWW):** A sends the HTTP request with the web server's IP address and Router B's MAC address as the Layer 2 destination [7](#page=7) [8](#page=8).
11. **ARP request (Router B to WWW):** Router B needs to send the HTTP request to the web server and thus needs its MAC address. Router B sends an ARP request for the web server's MAC address [7](#page=7) [8](#page=8).
12. **ARP reply (WWW to Router B):** The web server replies with its MAC address [7](#page=7) [8](#page=8).
13. **HTTP request (Router B to WWW):** Router B forwards the HTTP request to the web server [7](#page=7) [8](#page=8).
**Scenario 8: Host E fetches a webpage from www.nyheter.se (empty caches, WiFi network)**
This scenario details a web page retrieval process in a WiFi network with an access point acting as a switch [10](#page=10) [9](#page=9).
1. **ARP request (E to DNS):** Host E needs to resolve "www.nyheter.se". Since the DNS server is on a different subnet, E first sends an ARP request for its default gateway (likely a router associated with the access point) if it doesn't have it cached. However, the example shows an ARP request directly for the DNS server's MAC address, implying they might be on the same segment or the router handles this. The destination MAC is broadcast [10](#page=10).
2. **ARP reply (DNS to E):** The DNS server replies with its MAC address [10](#page=10).
3. **DNS request (E to DNS):** E sends a DNS request to the DNS server for "www.nyheter.se" [10](#page=10).
4. **DNS Reply (DNS to E):** The DNS server replies with the IP address of "www.nyheter.se" [10](#page=10).
5. **ARP request (E to Router):** E needs to send an HTTP request to the web server, which is on a different subnet. E sends an ARP request for its router's MAC address. The destination MAC is broadcast [10](#page=10).
6. **ARP reply (Router to E):** The router replies with its MAC address [10](#page=10).
7. **HTTP request (E to Router to Webserver):** E sends the HTTP request with the web server's IP address and the router's MAC address as the Layer 2 destination. The router then forwards the packet. The document notes that the router might not know the MAC address of the web server and might need to ARP for it on the destination network [10](#page=10).
### 1.3 Network address structures and analysis
Understanding IP and MAC addresses is fundamental to network communication analysis.
#### 1.3.1 MAC Addresses
MAC (Media Access Control) addresses are unique hardware identifiers assigned to network interfaces. They are used at Layer 2 for communication within a local network segment [2](#page=2) [3](#page=3) [5](#page=5).
#### 1.3.2 IP Addresses
IP (Internet Protocol) addresses are logical addresses used at Layer 3 to identify devices on a network and to route packets between networks [2](#page=2) [3](#page=3) [5](#page=5).
#### 1.3.3 Subnetting and Address Allocation
Networks are often divided into subnets to improve organization and efficiency.
* **CIDR Notation:** Classless Inter-Domain Routing (CIDR) notation, such as `/26` or `/29`, specifies the number of bits used for the network portion of an IP address. This determines the number of hosts that can be addressed within that subnet [11](#page=11) [12](#page=12).
* **Host ID Calculation:** For a subnet with `$n$` bits for the network ID and `$32-n$` bits for the host ID in IPv4, the total number of addresses is $2^{(32-n)}$. Subtracting two addresses for the network address and the broadcast address leaves the number of available hosts. For example, a `/26` subnet means 26 bits for the network, leaving 6 bits for hosts, thus $2^6 = 64$ total addresses, and $64-2=62$ usable hosts [11](#page=11) [6](#page=6).
* **Broadcast Addresses:** Each subnet has a broadcast address, which is a special IP address used to send data to all hosts within that subnet. For a `/29` subnet, the broadcast address can be determined based on the network address and the subnet mask [10](#page=10) [11](#page=11).
> **Tip:** When analyzing communication, always consider whether devices are on the same local network segment or if routing is involved. This will determine whether ARP is needed and how MAC addresses are resolved.
> **Example:** In scenario 1 (a), A needs to ping D. A does not know D's IP address initially. So A first performs DNS resolution to get D's IP address. Then, A needs to send the packet to its default gateway (R1), so it performs an ARP lookup for R1's MAC address. R1 then routes the packet to R2, and eventually to D. The entire process involves DNS, ARP, and ICMP messages.
### 1.4 Collision Domains and Network Segmentation
Understanding collision domains is essential for analyzing network performance, especially in older network topologies.
* **Collision Domain:** A collision domain is a network segment where data collisions can occur if two devices transmit data simultaneously [6](#page=6).
* **Hubs and Collisions:** Devices connected via a hub share the same collision domain. This limits simultaneous transmission and can lead to performance degradation as more devices are added [6](#page=6).
* **Switches and Routers:** Switches create separate collision domains for each port, significantly reducing collisions. Routers, by connecting different IP networks, also isolate collision domains [4](#page=4).
> **Tip:** Pay close attention to the type of device (hub, switch, router) connecting network segments. This is a key factor in determining how messages are propagated and what is visible on different links.
> **Example:** In task 2 (a), if Gizmo is a hub, A's IP packet to C will be seen on B's link because the hub broadcasts everything. If Gizmo is a switch, only the ARP request (if caches are empty) would be seen on B's link, as the switch intelligently forwards the IP packet directly to C.
---
# IP addressing and subnetting
This section examines IP addressing schemes, the process of subnetting networks, and the calculation of available host addresses within given network ranges, including the use of CIDR notation.
### 2.1 Understanding IP Addresses
IP addresses are fundamental to network communication, uniquely identifying devices on a network. The document implicitly refers to IPv4 addressing, which uses a 32-bit structure.
### 2.2 Subnetting Fundamentals
Subnetting is the process of dividing a larger network into smaller, more manageable subnetworks. This is achieved by borrowing bits from the host portion of an IP address to create a subnet identifier.
#### 2.2.1 Subnet Mask
A subnet mask is used in conjunction with an IP address to determine which part of the address represents the network and which part represents the host. It is a 32-bit number that has a binary value of '1' for network bits and '0' for host bits [6](#page=6).
#### 2.2.2 CIDR Notation
Classless Inter-Domain Routing (CIDR) is a method for specifying IP address allocation and routing. It uses a notation that indicates the number of bits used for the network portion of an IP address. For example, a `/24` indicates that the first 24 bits are used for the network ID, leaving 8 bits for host IDs [11](#page=11).
### 2.3 Calculating Available Host Addresses
The number of available host addresses within a subnet is determined by the number of bits allocated to the host portion of the IP address.
- The total number of addresses in a subnet is $2^h$, where $h$ is the number of host bits [12](#page=12).
- However, two addresses are reserved: the network address (host bits all set to 0) and the broadcast address (host bits all set to 1) [12](#page=12).
- Therefore, the number of usable host addresses is $2^h - 2$.
#### 2.3.1 Example Calculation
Consider a network with the address `135.230.15.128/26` [11](#page=11).
- The `/26` CIDR notation means that 26 bits are used for the network ID.
- This leaves $32 - 26 = 6$ bits for the host ID.
- The total number of addresses in this subnet is $2^6 = 64$.
- The number of usable host addresses is $2^6 - 2 = 64 - 2 = 62$ [11](#page=11) [12](#page=12).
> **Tip:** When calculating for a subnet, remember that the network address and broadcast address are reserved and cannot be assigned to hosts.
### 2.4 Subnetting Examples and Applications
The provided document includes several examples of subnetting scenarios and the determination of network addresses and host availability.
#### 2.4.1 Scenario: Adding Hosts to a Network
If a network is `8.168.1.0/24` it has 24 bits for the network ID and $32 - 24 = 8$ bits for the host ID. This allows for $2^8 - 2 = 256 - 2 = 254$ host addresses. If we want to add more hosts, we might need to re-evaluate the subnetting strategy or consider larger blocks. The question of how many host IDs are unused implies a current configuration where not all possible addresses within the `8.168.1.0/24` block are in use [6](#page=6).
#### 2.4.2 Scenario: Configuring Subnets with CIDR
For a network that requires two subnets, CIDR can be used to allocate appropriate address blocks. If a `/24` network is divided into two subnets, each subnet could be assigned a `/25` block. For instance, if the original network is `130.235.15.0/24` the two subnets could be `130.235.15.0/25` and `130.235.15.128/25`. Each of these `/25` subnets has $32 - 25 = 7$ host bits, yielding $2^7 - 2 = 128 - 2 = 126$ hosts per subnet [12](#page=12).
If a `/24` network is to be divided into four subnets, each could be assigned a `/26` block. For the network `130.235.15.0/24`, the subnets could be `130.235.15.0/26`, `130.235.15.64/26`, `130.235.15.128/26`, and `130.235.15.192/26`. Each `/26` subnet has $32 - 26 = 6$ host bits, resulting in $2^6 - 2 = 64 - 2 = 62$ hosts per subnet. The broadcast addresses for these subnets would be the last address in each block: `130.235.15.63`, `130.235.15.127`, `130.235.15.191`, and `130.235.15.255` respectively [12](#page=12).
> **Example:** A network `135.230.15.128/26` implies a network address of `135.230.15.128` and a subnet mask that reserves 26 bits for the network ID. This leaves 6 bits for host addresses. The first usable host IP is `135.230.15.129` and the last is `135.230.15.190`. The broadcast address is `135.230.15.191` [11](#page=11).
### 2.5 Network Device Roles in IP Addressing
The examples illustrate how different network devices interact with IP addresses during communication.
- **ARP (Address Resolution Protocol):** Used to resolve an IP address to a MAC address within the same local network segment. An ARP request is broadcast to all devices on the local network [11](#page=11) [9](#page=9).
- **Routers:** Devices that connect different IP subnets. They use routing tables to determine the next hop for IP packets destined for remote networks [6](#page=6).
- **DNS (Domain Name System):** Resolves human-readable domain names into IP addresses [9](#page=9).
#### 2.5.1 Example: IP Packet Transmission with ARP
When Computer A sends an IP packet to Computer B, and their ARP caches are empty, Computer A must first determine Computer B's MAC address.
1. **ARP Request:** Computer A broadcasts an ARP request on its local network, asking for the MAC address associated with Computer B's IP address. The ARP request's source IP is A's IP, and the destination IP is B's IP. The source MAC is A's MAC, and the destination MAC is the broadcast MAC address `FF:FF:FF:FF:FF:FF` [11](#page=11) [9](#page=9).
2. **ARP Reply:** If Computer B is on the same network, it will reply with its MAC address. The ARP reply's source IP is B's IP, and the destination IP is A's IP. The source MAC is B's MAC, and the destination MAC is A's MAC [11](#page=11).
3. **IP Packet:** Once A has B's MAC address, it can send the IP packet. The IP packet's source IP is A's IP, and the destination IP is B's IP. The source MAC is A's MAC, and the destination MAC is B's MAC [11](#page=11).
If B is on a different subnet, the packet will be sent to the default gateway (router) first. The ARP process would then occur between A and the router, and then potentially between the router and B (or intermediate devices).
#### 2.5.2 Host Location Determination
The examples demonstrate how to infer the network segment a host is connected to based on network traffic patterns and IP addresses.
- If an ARP request is sent from Host X to Host Y, and Y replies, they are likely on the same network segment [12](#page=12).
- If an IP packet from Host A to Host B goes through a router, it suggests B is on a different subnet [12](#page=12).
- If a device sends a request (e.g., DNS Request) and receives a reply without involving external routing, the devices are on the same network [12](#page=12).
- A device located "outside the network" would not typically participate in local ARP broadcasts or have its traffic relayed through local routers for intra-network communication scenarios described in these examples [12](#page=12).
---
# Network device behavior in different network topologies
This section explores how network devices like hubs, switches, and routers handle and transmit network messages, impacting network visibility and communication flow across various topologies.
### 3.1 Device behavior based on device type
The behavior of network devices when forwarding messages is fundamentally different, leading to varying levels of network visibility and message propagation.
#### 3.1.1 Hubs
When a hub is used, it operates at the physical layer (Layer 1) and essentially acts as a multi-port repeater. Any data packet received on one port is broadcasted to all other connected ports, regardless of the intended destination. This means all devices connected to a hub will see all traffic that passes through it [4](#page=4).
* **Scenario: A sends an IP packet to C, and address caches are updated.**
If Gizmo is a hub and A wants to send an IP packet to C (assuming they are on the same network and A knows C's MAC address), A will send an IP packet with C's IP address and C's MAC address. The hub will broadcast this packet on all its ports, so the link to B will also see this packet [4](#page=4).
* **Scenario: A sends an IP packet to C, and address caches are empty.**
If Gizmo is a hub and A does not know C's MAC address, A will first send an ARP request to find C's MAC address. This ARP request is broadcasted to B and C. The hub broadcasts this request to all ports. C's ARP reply will also be broadcasted by the hub to all ports, including the link to B. Subsequently, A's IP packet to C will also be broadcasted on all ports [5](#page=5).
#### 3.1.2 Switches
Switches operate at the data link layer (Layer 2) and are more intelligent than hubs. They maintain a MAC address table and learn which MAC addresses are connected to which ports. When a switch receives a frame, it examines the destination MAC address and forwards the frame only to the specific port where that MAC address is located [4](#page=4).
* **Scenario: A sends an IP packet to C, and address caches are updated.**
If Gizmo is a switch and A wants to send an IP packet to C (assuming they are on the same network and A knows C's MAC address), A sends an IP packet with C's IP address and C's MAC address. The switch will inspect the destination MAC address and forward the packet only to the port connected to C. Therefore, nothing will be seen on the link to B [4](#page=4).
* **Scenario: A sends an IP packet to C, and address caches are empty.**
If Gizmo is a switch and A does not know C's MAC address, A must first send an ARP request to discover C's MAC address. This ARP request is broadcasted. Since it's a broadcast, it will be seen on the link to B. Once C replies to the ARP request, the switch learns C's MAC address and associates it with the correct port. Subsequent traffic between A and C will be forwarded directly to C's port, and nothing further will be seen on the link to B [5](#page=5).
#### 3.1.3 Routers
Routers operate at the network layer (Layer 3) and are responsible for forwarding packets between different networks. When a router receives a packet, it examines the destination IP address. It then consults its routing table to determine the best path to reach the destination network and forwards the packet to the appropriate next-hop router or directly to the destination host if it's on a directly connected network. Routers do not forward broadcast traffic from one network to another (unless specifically configured to do so).
* **Scenario: A sends an IP packet to C, and address caches are updated.**
If Gizmo is a router, A will send its IP packet destined for C. A will use the MAC address of the router as the destination MAC address for the frame containing the IP packet. The router will then process the IP packet and route it towards C's network. Nothing will be seen on the link to B because the router is an intermediary device between A and C, and A is addressing the frame to the router, not directly to C's MAC address at this hop [4](#page=4).
* **Scenario: A sends an IP packet to C, and address caches are empty.**
If Gizmo is a router, A will first need to send an ARP request to obtain the router's MAC address since the router is the gateway to C's network. After receiving the router's MAC address, A sends the IP packet with the router's MAC address as the destination MAC address. The router then handles the routing. Nothing will be seen on the link to B, as A is communicating with the router, not directly with C's MAC address at this stage [4](#page=4) [5](#page=5).
### 3.2 Detailed packet flow for a web page request through a switch
This section details the sequence of packets and frames involved when a host (A) requests a web page from a web server (WWW) through a switch, assuming all address caches are initially empty. The scenario involves the resolution of IP addresses to MAC addresses, including DNS lookups.
* **Context:** Gizmo is a switch, and A wants to fetch a web page from "WWW" at the URL www.mypage.se/minsida.html.
* **Packet/Frame Breakdown:**
1. **Message:** ARP Request
* **From MAC:** A
* **To MAC:** Broadcast
* **From IP:** (A)
* **To IP:** (Router)
* **Description:** A needs to send an IP packet to C, but since caches are empty and C might be on a different network, A first needs the MAC address of the default gateway (router) to reach the internet. Therefore, A sends an ARP request to find the router's MAC address. This is broadcasted on the local segment.
2. **Message:** ARP Reply
* **From MAC:** Router
* **To MAC:** A
* **From IP:** (Router)
* **To IP:** - (Not applicable for ARP reply)
* **Description:** The router receives the ARP request and replies with its MAC address to A. The switch learns the router's MAC address and the port it's connected to.
3. **Message:** DNS Request
* **From MAC:** A
* **To MAC:** Router (MAC of the default gateway)
* **From IP:** A
* **To IP:** DNS Server IP
* **Description:** A sends a DNS request to resolve the IP address of www.mypage.se. This request is encapsulated in an IP packet with the destination IP address of the DNS server and is sent to the router's MAC address.
4. **Message:** ARP Request
* **From MAC:** Router
* **To MAC:** Broadcast
* **From IP:** (Router)
* **To IP:** (DNS Server)
* **Description:** The router, in turn, needs to send the DNS request to the actual DNS server. If the router does not have the DNS server's MAC address cached, it will send an ARP request for the DNS server's MAC address.
5. **Message:** ARP Reply
* **From MAC:** DNS Server
* **To MAC:** Router
* **From IP:** (DNS Server)
* **To IP:** -
* **Description:** The DNS server replies with its MAC address to the router.
6. **Message:** DNS Request
* **From MAC:** Router
* **To MAC:** DNS Server (MAC of the DNS server)
* **From IP:** Router (or source IP of A, depending on configuration)
* **To IP:** DNS Server IP
* **Description:** The router now forwards the DNS request to the DNS server using the DNS server's MAC address.
7. **Message:** DNS Reply
* **From MAC:** DNS Server
* **To MAC:** Router
* **From IP:** DNS Server IP
* **To IP:** Router IP (or A's IP)
* **Description:** The DNS server replies with the IP address of www.mypage.se to the router.
8. **Message:** DNS Reply
* **From MAC:** Router
* **To MAC:** A
* **From IP:** Router IP (or DNS Server IP)
* **To IP:** A's IP
* **Description:** The router forwards the DNS reply back to A. A now knows the IP address of www.mypage.se.
9. **Message:** HTTP Request
* **From MAC:** A
* **To MAC:** Router (MAC of the default gateway)
* **From IP:** A
* **To IP:** WWW IP address
* **Description:** A now sends the HTTP request for the web page to the web server's IP address. This request is framed with the router's MAC address as the destination MAC address.
10. **Message:** ARP Request
* **From MAC:** Router
* **To MAC:** Broadcast
* **From IP:** (Router)
* **To IP:** (WWW)
* **Description:** The router needs to send the HTTP request to the web server (WWW). It sends an ARP request to discover the MAC address of the web server.
11. **Message:** ARP Reply
* **From MAC:** WWW (Web Server)
* **To MAC:** Router
* **From IP:** (WWW)
* **To IP:** -
* **Description:** The web server replies with its MAC address to the router.
12. **Message:** HTTP Request
* **From MAC:** Router
* **To MAC:** WWW (MAC of the web server)
* **From IP:** Router IP (or A's IP)
* **To IP:** WWW IP address
* **Description:** The router finally forwards the HTTP request to the web server using the web server's MAC address.
* **Note on ARP Frames:** ARP requests and replies are transmitted as Ethernet frames, meaning they do not have an IP header. However, the IP addresses are included within the ARP header [5](#page=5).
---
# ARP and DNS protocol interactions
This section details the interaction between the Address Resolution Protocol (ARP) and the Domain Name System (DNS) in resolving network addresses and hostnames.
### 4.1 Address Resolution Protocol (ARP)
ARP is a crucial protocol used at the data link layer to map an IP address (Layer 3) to a physical hardware address, specifically a MAC address (Layer 2). When a host needs to send a packet to another host on the same local network, and it only knows the destination IP address but not its MAC address, it uses ARP [10](#page=10) [11](#page=11) [3](#page=3) [5](#page=5) [7](#page=7) [8](#page=8) [9](#page=9).
#### 4.1.1 ARP request and reply mechanisms
An ARP request is broadcast to all devices on the local network. This request contains the IP address of the target host and asks, "Who has this IP address? Tell me your MAC address.". The destination MAC address for an ARP request is the broadcast address (FF:FF:FF:FF:FF:FF) [10](#page=10) [3](#page=3) [5](#page=5) [7](#page=7) [8](#page=8) [9](#page=9).
The host that possesses the requested IP address responds with an ARP reply. This reply is unicast directly to the requesting host and contains its MAC address. [10](#page=10) [3](#page=3) [7](#page=7) [8](#page=8).
> **Tip:** ARP operates at the data link layer and does not inherently have an IP header. However, the IP addresses are included within the ARP header itself for resolution purposes [10](#page=10) [5](#page=5) [8](#page=8).
#### 4.1.2 ARP in communication scenarios
ARP is essential for initiating communication between hosts on the same subnet when their MAC addresses are unknown. For instance, if host A wants to send an IP packet to host C on the same network and their MAC addresses are not in A's cache, A will send an ARP request for C's IP address [4](#page=4) [5](#page=5).
When a host needs to communicate with a device on a different network, it first needs to resolve the MAC address of its default gateway (router). This is done via an ARP request for the router's IP address [10](#page=10) [2](#page=2) [3](#page=3) [7](#page=7) [8](#page=8).
### 4.2 Domain Name System (DNS)
DNS is a hierarchical and decentralized naming system for computers, services, or any resource connected to the Internet or a private network. It translates human-readable domain names (like `www.d.se` or `www.nyheter.se`) into machine-readable IP addresses (like `8.168.1.4`) [10](#page=10) [2](#page=2) [3](#page=3) [5](#page=5) [7](#page=7) [8](#page=8).
#### 4.2.1 DNS request and reply mechanisms
When a client host needs to resolve a domain name to an IP address, it sends a DNS request. This request is typically sent to a configured DNS server. The DNS request specifies the domain name to be resolved [2](#page=2) [3](#page=3) [7](#page=7) [8](#page=8).
The DNS server, upon receiving the request, either has the answer cached or queries other DNS servers to find the corresponding IP address. Once the IP address is found, the DNS server sends a DNS reply back to the requesting client, containing the resolved IP address [2](#page=2) [3](#page=3) [7](#page=7) [8](#page=8).
#### 4.2.2 DNS in communication scenarios
Before a host can send an IP packet to a destination using its domain name, it must first use DNS to resolve that domain name into an IP address. This process typically involves an ARP request for the DNS server's MAC address if it's on the local network, followed by the DNS request. [10](#page=10) [2](#page=2) [3](#page=3) [7](#page=7) [8](#page=8).
> **Example:** If host A wants to ping `www.d.se`, and A's ARP and routing tables are empty, the sequence of events will be:
> 1. A initiates a DNS request to resolve `www.d.se` to an IP address. This requires A to know the IP address of its DNS server.
> 2. To send the DNS request to the DNS server, A might need to perform an ARP request to find the MAC address of the DNS server if it's on the same local network, or the MAC address of its default gateway if the DNS server is on a different network.
> 3. Once the MAC address is resolved (either for the DNS server or the gateway), the DNS request is sent.
> 4. The DNS server replies with the IP address of `www.d.se`.
> 5. Now that A has the IP address of `www.d.se`, it can proceed with the ping. This will involve an ARP request to resolve the MAC address of `www.d.se` (or the next-hop router if `www.d.se` is on a different network), followed by the ICMP Echo Request (ping) [2](#page=2) [3](#page=3) [7](#page=7) [8](#page=8).
### 4.3 ARP and DNS protocol interactions
The interaction between ARP and DNS is fundamental for name-based communication on IP networks. When a user or application requests a service using a domain name, DNS is employed to find the IP address, and ARP is then used to find the MAC address needed to deliver the packet to the correct destination on the local network segment [10](#page=10) [2](#page=2) [3](#page=3) [5](#page=5) [7](#page=7) [8](#page=8).
The typical flow for a host initiating communication with a remote host by its domain name, assuming empty caches, is as follows:
1. **DNS Resolution:**
* The host needs to know the IP address of the DNS server. If the DNS server is on the local network, the host will first send an **ARP request** to discover the DNS server's MAC address.
* The DNS server replies with its MAC address via an **ARP reply**.
* The host then sends a **DNS request** to the DNS server, asking for the IP address of the target domain name.
* The DNS server responds with a **DNS reply** containing the target IP address.
2. **Packet Transmission:**
* Now that the host has the target IP address, it needs to send an IP packet.
* If the target IP address is on a different network, the host needs the MAC address of its default gateway. It sends an **ARP request** for the default gateway's IP address.
* The default gateway responds with an **ARP reply**.
* The host then sends the IP packet (e.g., ICMP Echo Request for ping, or HTTP Request for web browsing) destined for the target IP address, using the gateway's MAC address as the Layer 2 destination. [10](#page=10) [2](#page=2) [3](#page=3) [5](#page=5) [7](#page=7) [8](#page=8).
* If the target IP address is on the same local network, the host sends an **ARP request** directly for the target IP address.
* The target host responds with an **ARP reply**, and the IP packet is then sent directly to the target's MAC address. [4](#page=4) [5](#page=5).
> **Key Interaction:** DNS provides the "what" (IP address), and ARP provides the "how" (MAC address) for local delivery. They work in tandem, with DNS resolution often preceding ARP resolution when communicating via domain names.
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Host | A computer or other device connected to a computer network that participates by receiving, sending, or forwarding information. |
| Router | A networking device that forwards data packets between computer networks. Routers perform the traffic directing functions on the Internet. |
| DNS Server | A server that translates domain names (like www.example.com) into IP addresses (like 192.168.1.1) that computers can use to connect to each other. |
| Ethernet Switch | A network device that connects multiple devices on a local area network (LAN) using packet switching to receive, process, and forward data to the destination device. |
| MAC Address | A unique identifier assigned to network interfaces for communications at the data link layer of a network segment. It is also known as a physical address or hardware address. |
| IP Address | A numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. It serves to identify the device and provide location addressing. |
| Default Gateway | The node (typically a router) that serves as the access point to leave a local network and reach other networks, such as the internet. |
| ARP Request | A network protocol data unit used to request the MAC address associated with a known IP address on a local network. It is typically broadcast to all devices on the network segment. |
| ARP Reply | A network protocol data unit sent in response to an ARP Request, providing the MAC address that corresponds to the requested IP address. |
| DNS Request | A query sent by a client to a DNS server to resolve a domain name into an IP address. |
| DNS Reply | The response from a DNS server to a DNS request, containing the IP address corresponding to the queried domain name. |
| ICMP Echo Request | A message sent by the Internet Control Message Protocol (ICMP) to request a response from a specific host, commonly used for network diagnostics like ping. |
| ICMP Echo Reply | The response received by an ICMP Echo Request, indicating that the target host is reachable and responding. |
| Broadcast | A message sent to all devices on a network segment simultaneously. |
| Hub | A basic network device that connects multiple computers or other network devices together, repeating any data it receives on one port to all other ports. |
| Collision Domain | A network segment where data packets collide if more than one device attempts to transmit data at the same time. Devices connected by a hub are in the same collision domain. |
| Subnet | A logical subdivision of an IP network. Subnetting allows for more efficient use of IP address space and improved network management. |
| CIDR Notation | Classless Inter-Domain Routing notation, a compact way to represent an IP address and its associated routing prefix. It uses a slash followed by the number of bits in the network portion of the address (e.g., /24). |
| Broadcast Address | A special IP address within a subnet used to send a message to all hosts on that subnet simultaneously. |
| HTTP Request | A message sent by a client (like a web browser) to a web server to request a specific web page or resource. |
| TCP/UDP | Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are transport layer protocols used for end-to-end communication. TCP provides reliable, ordered delivery, while UDP is a simpler, faster, but less reliable protocol. |
| IEEE 802.11 | A family of specifications for wireless local area networks (WLANs), commonly known as Wi-Fi. |
Cover
EITF45 övning 4 (FL7) Routing uppgifter med lösningar.pdf
Summary
# Flooding in network routing
Flooding is a routing technique where a packet is sent to all available router ports and is only terminated when its Time To Live (TTL) expires [2](#page=2).
### 1.1 Mechanism of flooding
When a packet is transmitted using flooding, it is sent out from a router to all its connected neighbors, except for the neighbor from which the packet was received. This process continues as the packet propagates through the network, with each router forwarding the packet to all its other ports [2](#page=2).
### 1.2 Time To Live (TTL) and packet termination
To prevent packets from circulating indefinitely in the network, a hop count or Time To Live (TTL) mechanism is employed [2](#page=2).
* As a packet leaves a router, its TTL value is decremented by one. This decrement includes the originating router [2](#page=2).
* When a packet's TTL reaches zero, it is discarded and no longer propagated through the network. This ensures that flooding eventually terminates [3](#page=3).
### 1.3 Packet propagation illustration
The propagation of flooded packets can be visualized by tracking their spread and the decreasing TTL values. Packets can be distinguished by the "color" of their original source branch, with numbers indicating the current TTL value [2](#page=2) [4](#page=4).
#### 1.3.1 Example of flooding with a hop limit
Consider a network where a packet is sent from a source node with a hop count (TTL) of 3 [2](#page=2).
* **Hop 1:** The initial packet is sent from the source with TTL=3. It is then forwarded to neighboring routers, each decrementing the TTL to 2 [2](#page=2).
* **Hop 2:** Routers receive packets with TTL=2 and forward them to their other neighbors, decrementing the TTL to 1 [2](#page=2).
* **Hop 3:** Routers receive packets with TTL=1 and forward them, decrementing the TTL to 0. Packets with TTL=0 are discarded [2](#page=2).
This sequential spreading illustrates how the hop limit controls the reach of the flooded packets [2](#page=2) [3](#page=3).
> **Example:** In a network, to ensure a packet reaches destination E from source A, the minimum TTL required is 3 hops. This is because the shortest path from A to E involves traversing at least three routers (e.g., A -> B -> D -> E) [4](#page=4).
#### 1.3.2 Calculating the total number of packets
When flooding with a hop limit is used, the total number of packets generated can be significant. This count includes the initial packet and all subsequent copies forwarded by routers until their TTL expires [4](#page=4).
> **Example:** In a scenario where a packet needs to reach destination E, and the hop limit is set to 3, the total number of packets generated throughout the network can be 14. This count accounts for the initial packet and all its replicated versions that are transmitted before their TTL reaches zero [4](#page=4).
---
# Distance vector routing protocols
Distance vector routing protocols are a fundamental class of routing protocols where routers maintain routing tables containing distance (or cost) and vector (or next hop) information to reach various network destinations. Routers using this method share their entire routing tables with their directly connected neighbors periodically. This information is then used by each router to update its own routing table by comparing its current knowledge with that received from neighbors [5](#page=5) [9](#page=9).
### 2.1 Core principles of distance vector routing
In distance vector routing, each router knows how to reach a network by identifying which next node to send a packet to, ultimately reaching that network. Routers are aware of the networks they are directly connected to and periodically share this information with their neighbors. When a router receives an update message from a neighbor, it increments the hop count for each destination in the neighbor's table by one, as it takes one hop to reach that neighbor. The router then compares these updated distances with its own current routing table. If a path through the neighbor offers a shorter distance (fewer hops) to a destination, the router updates its table with the new, shorter path, indicating the neighbor as the next hop. If the new path is longer, the existing entry is retained [5](#page=5) [9](#page=9).
> **Tip:** The core idea is "routing by rumor." Routers learn about the network topology indirectly from their neighbors rather than having a global view of the entire network [9](#page=9).
### 2.2 Routing table updates and convergence
The process of updating routing tables involves receiving information from neighbors, calculating new path costs, and comparing them with existing entries.
#### 2.2.1 Example: Updating a routing table
Consider router X, which has the following routing table:
| Network ID | Hops | Router |
| :----------- | :--- | :----- |
| Net 2 | 6 | A |
| Net 3 | 4 | C |
| Net 4 | 3 | A |
| Net 6 | 2 | C |
| Net 7 | 3 | B |
Router X receives an update message from its neighbor, router C, with the following information:
| Network ID | Hops |
| :--------- | :--- |
| Net 2 | 6 |
| Net 3 | 4 |
| Net 4 | 1 |
| Net 6 | 2 |
| Net 7 | 3 |
To update its table, router X adds one hop to each entry from router C's table, as it takes one hop to reach C:
* Net 2: C reports 6 hops. Via C, X would need $6 + 1 = 7$ hops. X's current table shows 6 hops. X keeps the old value [5](#page=5).
* Net 3: C reports 4 hops. Via C, X would need $4 + 1 = 5$ hops. X's current table shows 4 hops. X updates its value to 5 hops, with C as the next node [5](#page=5).
* Net 4: C reports 1 hop. Via C, X would need $1 + 1 = 2$ hops. X's current table shows 3 hops. X updates its value to 2 hops, with C as the next node [5](#page=5).
* Net 6: C reports 2 hops. Via C, X would need $2 + 1 = 3$ hops. X's current table shows 2 hops. X updates its value to 3 hops, with C as the next node [5](#page=5).
* Net 7: C reports 3 hops. Via C, X would need $3 + 1 = 4$ hops. X's current table shows 3 hops. X keeps the old value [5](#page=5).
The updated routing table for router X would be:
| Network ID | Hops | Router | Description |
| :--------- | :--- | :----- | :------------------------------------------- |
| Net 2 | 6 | A | To Net2 via C requires 7 hops. Keep old value. |
| Net 3 | 5 | C | Number of hops increased. Update value. |
| Net 4 | 2 | C | To Net4 via C requires 2 hops. Update value. |
| Net 6 | 3 | C | Number of hops increased. Update value. |
| Net 7 | 3 | B | To Net7 via C requires 4 hops. Keep old value. |
#### 2.2.2 Network convergence
Convergence in distance vector routing refers to the state where all routers in the network have consistent and accurate routing information, and they have stabilized their routing tables. This process can take time, as information propagates hop by hop through the network. During convergence, routers may exchange multiple updates as they learn about new paths or changes in the network topology [8](#page=8).
> **Tip:** Distance vector protocols are susceptible to slow convergence and issues like count-to-infinity problems if not properly managed with mechanisms like split horizon and poison reverse, although these are not detailed in the provided text.
### 2.3 Initial vs. final routing tables
At the beginning of network operation, or after a topology change, routers have initial routing tables. These tables typically reflect only directly connected networks or information received from immediate neighbors.
For example, router R5 in Figure 1 of the document has an initial routing table that lists directly connected networks without any next hop or hop count information, indicating these are local links:
| Network | Next node | Hops |
| :------------------ | :-------- | :--- |
| 10.0.31.128/24 | - | - |
| 10.0.32.128/24 | - | - |
| 10.0.33.128/24 | - | - |
| 10.0.34.128/24 | - | - |
After the network converges, R5's routing table will contain entries for all reachable networks, including those not directly connected. The "Next node" column will indicate the neighbor router to which a packet should be sent to reach that destination, and the "Hops" column will show the shortest path cost in terms of hops [8](#page=8) [9](#page=9).
For instance, a converged routing table for R5 might look like this (assuming specific updates and convergence order):
| Network | Next node | Hops |
| :------------- | :---------- | :--- |
| 10.0.31.128/24 | - | - |
| 10.0.32.128/24 | - | - |
| 10.0.10.128/24 | 10.0.32.1 | 1 |
| 10.0.2.128/24 | 10.0.31.1 | 1 |
| 10.0.33.128/24 | - | - |
| 10.0.34.128/24 | - | - |
| 10.0.4.128/24 | 10.0.32.1 | 1 |
This final table signifies that to reach network 10.0.10.128/24, R5 should send the packet to the next node 10.0.32.1, and this path requires 1 hop (presumably from R5 to a router with IP 10.0.32.1, which then has direct or short access to the destination network). Networks without a next node and hop count, like 10.0.31.128/24, are likely directly connected and do not require routing to reach [9](#page=9).
---
# Link state routing protocols
Link state routing protocols operate by having each router construct a complete map of the network topology, enabling them to calculate shortest paths.
## 3 Link state routing protocols
Link state routing protocols operate on the principle that each router possesses a complete understanding of the network's topology. This global view allows routers to independently calculate the shortest path to every other node in the network from their own perspective. Unlike distance vector protocols, link state routers do not rely on periodic updates from neighbors about their routing tables; instead, they exchange information about the state of their directly connected links [8](#page=8) [9](#page=9).
### 3.1 Core principles of link state routing
In link state routing, a cost is assigned to each available path within the network. Each router maintains an awareness of all accessible paths and uses this information to build an internal map of the entire network. This map is then used to run a shortest path algorithm, such as Dijkstra's algorithm, to determine the optimal route to each destination [8](#page=8) [9](#page=9).
### 3.2 Initial messages and network convergence
When a router using a link state protocol starts up or joins the network, it sends an initial message that contains information about its directly connected links and their associated costs. This message, often referred to as a Link State Advertisement (LSA), is flooded throughout the network so that all routers can receive it [9](#page=9).
**Example:**
For router R5, the initial message it sends out in a link state protocol would detail the cost to its directly connected networks. For instance, if R5 is directly connected to networks with costs of 9, 1, 2, and 3, its initial routing table would reflect these direct connections and costs [10](#page=10) [9](#page=9).
> **Tip:** The initial routing table in a link state protocol reflects only the directly known links and their costs. The complete routing table, showing shortest paths to all networks, is only formed after the network converges.
After all routers have exchanged their link state information and flooded these LSAs, the network converges. At this point, every router has an identical and complete map of the network topology. Each router then independently executes a shortest path algorithm to calculate the shortest path to every other network and builds its final routing table [8](#page=8).
**Example:**
Following network convergence, router R5's final routing table would include entries for all networks in the topology, not just those directly connected. For instance, it might show a path to network `10.0.2.128/24` via `10.0.32.1` with a total cost of 6, and a path to network `10.0.4.128/24` also via `10.0.32.1` with a total cost of 5. The table also lists the direct connections with their respective costs, such as network `10.0.32.128/24` with a cost of 1 [10](#page=10).
> **Tip:** To fully understand the convergence process for link state routing, it is essential to trace the path and accumulated cost from the source router to each destination network using the network map and shortest path algorithm.
---
# Network topology and visualization
This topic covers the process of drawing and visualizing network topologies based on routing table information, detailing routers, subnets, and links after configuration changes or protocol convergence [5](#page=5) [6](#page=6) [7](#page=7).
### 4.1 Understanding network topology from routing tables
Distance-vector routing protocols involve routers periodically exchanging their routing tables with neighbors. This exchange allows routers to learn about the network's structure and the cost (hops or other metrics) to reach various network IDs. When a router receives an update, it compares the new information with its existing table and updates its entries if a shorter path is found or if new network information is acquired [5](#page=5) [6](#page=6).
#### 4.1.1 Router neighbor discovery and path calculation
A router's routing table indicates its direct neighbors and the cost to reach different network IDs. If a network ID has no "next node" listed, it typically signifies that the router is directly connected to that network. When an update is received from a neighbor, the cost to reach each network ID in the update is increased by one (representing the hop to the neighbor). The router then compares this new path cost with its current best path cost for that network ID [5](#page=5) [6](#page=6).
> **Tip:** When updating a routing table based on a neighbor's information, remember to increment the hop count for each entry received from the neighbor.
#### 4.1.2 Updating routing tables with new information
The process of updating a routing table involves several steps:
1. **Receive update:** A router receives a routing update message from a neighbor [5](#page=5).
2. **Increment costs:** For each network ID in the received update, add one hop to the cost to account for the link to the neighbor [5](#page=5).
3. **Compare and update:** Compare the newly calculated costs with the existing costs in the router's own routing table [5](#page=5).
* If the new path is shorter (lower cost) or if the network ID was not previously in the table, update the table with the new information, including the neighbor as the next hop [5](#page=5).
* If the new path is longer or equal in cost, keep the old entry [5](#page=5).
* If a network is directly connected (no next hop), its cost remains the same unless a better path is found via a neighbor [6](#page=6).
#### 4.1.3 Visualizing network topology
After processing routing updates, the network topology can be visualized by drawing the routers and the links between them, representing subnets and their connections [6](#page=6) [7](#page=7).
* **Routers:** Represented as nodes in the network diagram [6](#page=6) [7](#page=7).
* **Subnets/Networks:** Represented as connections or distinct areas within the diagram, often associated with link IDs [5](#page=5) [6](#page=6).
* **Links:** Lines connecting routers, indicating a physical or logical connection, and potentially representing a subnet [5](#page=5) [6](#page=6).
* **Neighbor relationships:** Inferred from routing table entries that list a specific router as the "next node" [6](#page=6).
* **Directly connected networks:** Identified by entries in the routing table with no "next node" specified [6](#page=6).
> **Example:** In the provided exercises, Router A initially knows about its neighbor D and directly connected networks 1 and 6. When it receives an update from a new router E, it incorporates E's routing information, potentially discovering new paths or networks through E. The visualization then reflects these updated adjacencies and paths [6](#page=6) [7](#page=7).
### 4.2 Example: Network configuration update and visualization
Consider a scenario where a router receives an update from a new neighbor, Router E. Router A's routing table is updated based on this information [6](#page=6) [7](#page=7).
**Initial state (Router A's known information):**
* Networks 1 and 6 are directly connected (cost 1, no next node) [6](#page=6).
* Network 4 is reachable via Router D with a cost of 3 [6](#page=6).
* Network 2 is reachable via Router D with a cost of 4 [6](#page=6).
* Network 5 is reachable via Router D with a cost of 2 [6](#page=6).
* Network 3 is reachable via Router D with a cost of 2 [6](#page=6).
**Update from Router E:**
Router E provides information about its reachable networks. For example, it might state it can reach Network 2 with a cost of 1 [7](#page=7).
**Router A's updated routing table after processing E's update:**
* Net1: Cost 1 (Directly connected) [7](#page=7).
* Net2: Cost 2 (Via E, since E's cost to Net2 is 1, plus 1 hop to E) [7](#page=7).
* Net3: Cost 2 (Via D, original entry) [7](#page=7).
* Net4: Cost 3 (Via D, original entry) [7](#page=7).
* Net5: Cost 2 (Via D, original entry) [7](#page=7).
* Net6: Cost 1 (Directly connected) [7](#page=7).
* Net7: Cost 3 (Via E, assuming E's cost to Net7 is 2, plus 1 hop to E) [7](#page=7).
**Visualization of the new network:**
The updated routing table allows for a drawing of the network that includes Router E and the paths that now lead through it. This may reveal a more connected or efficient network structure than initially apparent. The diagram would show routers A, D, and E, along with their respective connections and the subnets they can reach, reflecting the latest routing information [7](#page=7).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Flooding | A routing technique where a packet is sent to all router ports and is only terminated when its Time To Live (TTL) expires. As a packet arrives at a router, it is relayed to all other ports except the one it arrived on. |
| Hop count | A metric used in routing to limit the propagation of packets, effectively setting a maximum number of routers a packet can traverse before being discarded. This prevents infinite loops and excessive network traffic. |
| Time To Live (TTL) | A mechanism used in network packets to prevent them from circulating indefinitely on a network. Each router that processes the packet decrements the TTL value, and the packet is discarded when the TTL reaches zero. |
| Distance Vector Routing | A class of routing protocols where each router advertises its routing table to its directly connected neighbors. Routers then use this information to calculate the shortest path to destinations, updating their tables based on received updates. |
| Routing Table | A data table stored in a router that lists the available routes to various network destinations. It typically includes the destination network, the next hop router to forward the packet to, and the cost or number of hops to reach that destination. |
| Link State Routing | A routing protocol where each router builds a complete map of the network's topology. Routers exchange information about their directly connected links and their costs, allowing each router to independently calculate the shortest path to all other nodes using algorithms like Dijkstra's. |
| Stub Net | A network that connects to only one router, meaning it has a single point of entry or exit to the larger network. |
| Convergence | The process by which all routers in a network agree on the same network topology and routing information. This occurs after changes are made to the network or when routing protocols have exchanged sufficient updates to establish consistent routing tables. |
| Neighbor | In the context of routing protocols, a neighbor refers to a directly connected router with which routing information is exchanged. |
| Cost | A metric used in routing protocols to represent the 'expense' or desirability of a particular path. Lower cost typically indicates a more favorable path, often based on factors like bandwidth, latency, or hop count. |
Cover
EITF45 övning 4 (FL8) Header uppgifter med lösningar.pdf
Summary
# Ethernet frame analysis
Ethernet frame analysis involves dissecting the structure of an Ethernet frame to identify crucial components like MAC addresses and understand the encapsulated data [13](#page=13) [2](#page=2).
### 1.1 Ethernet II frame structure overview
An Ethernet II frame is a standard data link layer frame used for local area networks. While preamble and Start Frame Delimiter (SFD) are typically present, they are often removed when analyzing the raw frame data for content. The core of the frame, after these initial bits, begins with the destination MAC address and the source MAC address [2](#page=2).
### 1.2 Identifying MAC addresses
MAC addresses are fundamental identifiers in Ethernet communication and are crucial for frame delivery on a local network segment [13](#page=13) [2](#page=2).
#### 1.2.1 Destination MAC address (DA)
The destination MAC address is the first 6 bytes of the Ethernet header following the preamble and SFD. It indicates the intended recipient of the frame on the local network [2](#page=2).
* **Example:** In a given hexadecimal frame, if the first 6 bytes are `08 00 20 7c 94 1c`, this represents the destination MAC address `08:00:20:7C:94:1C` [2](#page=2).
* A special destination MAC address is `ff ff ff ff ff ff`, which signifies broadcast to all devices on the link [13](#page=13).
#### 1.2.2 Source MAC address (SA)
The source MAC address is the next 6 bytes of the Ethernet header, immediately following the destination MAC address. It identifies the sender of the frame [2](#page=2).
* **Example:** Continuing the previous example, if the next 6 bytes are `00 00 39 51 90 37`, this is the source MAC address `00:00:39:51:90:37` [2](#page=2).
### 1.3 Analyzing encapsulated protocols
Beyond MAC addresses, the Ethernet II frame header contains a type field that indicates the protocol encapsulated within the frame's data payload [13](#page=13) [2](#page=2).
#### 1.3.1 Type field interpretation
The type field is a 2-byte value. A common example is `0800` in hexadecimal, which signifies that the payload is an Internet Protocol (IP) packet. Another example is `0806`, which indicates an Address Resolution Protocol (ARP) message [13](#page=13) [2](#page=2).
#### 1.3.2 IP packet analysis within Ethernet frames
When an Ethernet frame carries an IP packet, analyzing the IP packet's header provides further details about the network communication [2](#page=2) [3](#page=3).
* **IP Header Length:** The IP header itself has a field that specifies its length, often expressed in 32-bit words. For instance, a value of `0x5` in this field signifies an IP header length of $5 \times 32 \text{ bits} = 160 \text{ bits}$, which equates to 20 bytes. This length is sufficient to include essential IP header fields like the destination IP address, without requiring options [3](#page=3).
* **Encapsulated Protocol:** The IP header also contains a protocol field that identifies the next-level protocol being carried, such as UDP or TCP. A value of `0x11` in this field corresponds to UDP (User Datagram Protocol) [3](#page=3).
### 1.4 Frame padding
Ethernet frames may be padded to meet a minimum length requirement, ensuring efficient processing by network hardware and preventing collisions in older Ethernet standards. If the length of the frame's content (Ethernet header + encapsulated payload) exceeds the minimum Ethernet frame size, padding is not necessary. However, if the content is shorter than the minimum, padding is added to reach the minimum frame length [13](#page=13).
> **Tip:** When analyzing frames, remember to account for the possibility of padding, as it affects the overall frame length and can be an indicator of specific network conditions or protocols [13](#page=13).
---
# IP packet header examination
This section details the examination of IPv4 and IPv6 packet headers to extract crucial networking information, including source and destination addresses, header lengths, protocol types, and fragmentation details [14](#page=14) [2](#page=2) [3](#page=3) [4](#page=4) [5](#page=5).
### 2.1 IPv4 packet header structure and fields
The IPv4 header contains various fields essential for routing and managing IP packets. Understanding these fields allows for the interpretation of packet behavior and network conditions [3](#page=3).
#### 2.1.1 Key IPv4 header fields
* **Version:** Indicates the IP version, which is '4' for IPv4 [3](#page=3).
* **Internet Header Length (IHL):** Specifies the length of the IP header in 32-bit words. The minimum value is 5 (20 bytes), meaning there are no options [3](#page=3).
* **Calculation:** Header Length (bytes) = IHL $\times$ 4 [3](#page=3).
* **Protocol:** Identifies the protocol of the data payload. Common values include 6 for TCP and 17 for UDP [3](#page=3).
* **Identification:** Used to uniquely identify a group of fragments belonging to a single IP datagram [4](#page=4) [5](#page=5).
* **Flags:** A 3-bit field that controls fragmentation.
* Bit 0: Reserved (must be zero).
* Bit 1: Don't Fragment (DF) flag. If set, the packet must not be fragmented.
* Bit 2: More Fragments (MF) flag. If set, it indicates that this is not the last fragment.
* **Fragment Offset:** A 13-bit field that indicates the position of a fragment in the reassembled datagram, measured in 8-byte blocks [5](#page=5).
* **Source IP Address:** The IP address of the sender [3](#page=3).
* **Destination IP Address:** The IP address of the intended recipient [3](#page=3).
> **Tip:** The Identification field is crucial for reassembling fragmented packets, as it binds together all fragments belonging to the same original datagram [4](#page=4).
#### 2.1.2 Examining IPv4 fragmentation
Fragmentation allows large IP datagrams to be divided into smaller pieces to traverse networks with smaller Maximum Transmission Units (MTUs) [4](#page=4).
* **Frame 1 Analysis:**
* Flags: `00100000` (binary) indicates "More fragments, no fragmentation offset." [5](#page=5).
* **Frame 2 Analysis:**
* Flags: `00100000 10111001` (binary) indicates "More fragments, fragment offset of 1480 bytes." [5](#page=5).
* **Frame 3 Analysis:**
* Flags: `00000001 01110010` (binary) indicates "Fragmented, last fragment, fragment offset of 2960 bytes." [5](#page=5).
* The fragment offset is calculated in 8-byte blocks [5](#page=5).
> **Example:** If the Fragment Offset is `0172` in hexadecimal, it represents `2960` in decimal, which corresponds to a data offset of `2960` bytes from the beginning of the original datagram [5](#page=5).
### 2.2 IPv6 packet header structure and fields
The IPv6 header is designed to be simpler and more efficient than the IPv4 header, with a fixed size and the use of extension headers for optional information [14](#page=14).
#### 2.2.1 Key IPv6 header fields
* **Version:** Indicates the IP version, which is '6' for IPv6 [14](#page=14).
* **Traffic Class:** Used to differentiate IP packets for traffic shaping and other QoS purposes [14](#page=14).
* **Flow Label:** Used to identify sequences of packets that require special handling by intermediate routers [14](#page=14).
* **Payload Length:** The length of the payload in bytes, including any extension headers [14](#page=14).
* **Next Header:** Identifies the type of header immediately following the current IPv6 header. This can be another IPv6 extension header or the transport layer protocol (e.g., TCP, UDP) [14](#page=14).
* **Hop Limit:** The maximum number of hops (routers) that the packet is allowed to traverse. This is equivalent to the TTL field in IPv4 [14](#page=14).
* **Example:** A Hop Limit of `80` in hexadecimal is equal to `128` in decimal [14](#page=14).
* **Source IP Address:** The IPv6 address of the sender [14](#page=14).
* **Destination IP Address:** The IPv6 address of the intended recipient [14](#page=14).
> **Tip:** IPv6 has a fixed header size of 40 bytes, which simplifies processing for routers compared to the variable-length IPv4 header [14](#page=14).
#### 2.2.2 Example IPv6 header examination
An example Wireshark capture shows an Ethernet frame containing an IPv6 packet [14](#page=14).
* **Frame Type:** The Type field of the Ethernet header is `86dd`, indicating an IPv6 datagram [14](#page=14).
* **Source Address:** `2001:16D8:CC3A:0BF6:D491:66C2:CFC2:0271` [14](#page=14).
* **Destination Address:** `2001:09B0:0100:0004:0000:0000:0000:0004` [14](#page=14).
* **Total Packet Length:** The Payload length field indicates `28` in hexadecimal, which is `40` bytes. Combined with the 40-byte IPv6 header, the total datagram length is `80` bytes [14](#page=14).
* **Hop Limit:** The Hop Limit field shows `80` in hexadecimal, translating to `128` in decimal. This means the datagram will be dropped by the 128th router [14](#page=14).
---
# TCP segment analysis
This section delves into the analysis of Transmission Control Protocol (TCP) segments, focusing on the interpretation of key header fields such as source and destination ports, sequence and acknowledgment numbers, and window sizes, with specific attention to understanding Telnet conversations.
### 3.1 Understanding TCP header fields
TCP segments are the fundamental units of data transfer in the TCP protocol. Analyzing the header of these segments is crucial for understanding the flow of data and the state of a connection.
#### 3.1.1 Source and destination ports
The source and destination ports are 16-bit fields that identify the specific application or service running on the source and destination hosts, respectively. These ports are essential for demultiplexing incoming data to the correct application [7](#page=7) [8](#page=8).
* **Source Port:** Identifies the port number of the sending application [7](#page=7) [8](#page=8).
* **Destination Port:** Identifies the port number of the receiving application [7](#page=7) [8](#page=8).
> **Tip:** Well-known ports are often associated with specific services (e.g., port 23 for Telnet, port 80 for HTTP). Knowing these can help infer the type of communication.
#### 3.1.2 Sequence number
The sequence number is a 32-bit field that indicates the position of the segment's data within the overall byte stream of the connection. It allows the receiver to reassemble segments in the correct order [11](#page=11) [8](#page=8).
#### 3.1.3 Acknowledgment number
The acknowledgment number is a 32-bit field that, if the ACK flag is set, contains the value of the next sequence number the sender expects to receive. This confirms successful reception of data up to the acknowledged sequence number [11](#page=11) [8](#page=8).
#### 3.1.4 Window size
The window size is a 16-bit field that indicates the number of bytes, starting from the acknowledgment number, that the receiver is willing to accept. This mechanism is used for flow control, preventing the sender from overwhelming the receiver [11](#page=11) [8](#page=8).
* The window size is expressed in bytes [11](#page=11) [8](#page=8).
* A larger window size allows for more data to be in transit, potentially leading to higher throughput [10](#page=10) [11](#page=11).
#### 3.1.5 Header size (Data Offset)
The Data Offset field, often referred to as the header size, is a 4-bit field that specifies the size of the TCP header in 32-bit words. Since the header size can vary due to options, this field is crucial for determining where the actual data payload begins. The minimum TCP header size is 20 bytes [7](#page=7) [8](#page=8).
> **Tip:** If the Data Offset field indicates 5 (5 * 4 = 20 bytes), it means there are no TCP options present [8](#page=8).
### 3.2 Analyzing TCP segments with examples
The provided document offers exercises that demonstrate how to dissect TCP headers from hexadecimal dumps.
#### 3.2.1 Exercise 5: Basic header analysis
This exercise involves analyzing a given hexadecimal TCP header to extract specific fields.
**Hexadecimal Header:**
`05320017 00000001 00000000 500207FF 00000000` [7](#page=7).
**Analysis:**
* **Source Port:** `0532` (hex) = `1330` (decimal) [8](#page=8).
* **Destination Port:** `0017` (hex) = `23` (decimal) [8](#page=8).
* **Sequence Number:** `00000001` (hex) = `1` (decimal) [8](#page=8).
* **Acknowledgment Number:** `00000000` (hex) = `0` (decimal) [8](#page=8).
* **Data Offset and Flags:** `5002` (hex) [8](#page=8).
* **Window Size:** `07FF` (hex) = `2047` (decimal) bytes [8](#page=8).
> **Example:** To determine the header size from `5002`, we look at the first 4 bits which represent the number of 32-bit words. `5` in binary is `0101`. Thus, the header size is 5 * 4 = 20 bytes [8](#page=8).
#### 3.2.2 Exercise 6: Telnet conversation analysis
This exercise involves analyzing multiple Ethernet frames containing TCP segments to understand a Telnet conversation. Telnet typically uses port 23 [11](#page=11) [8](#page=8).
The analysis involves:
1. Identifying the TCP segment within the Ethernet frame by accounting for the Ethernet header (14 bytes) and the IPv4 header (20 bytes) [11](#page=11).
2. Dissecting the TCP header fields (source port, destination port, sequence number, acknowledgment number, window size) [11](#page=11).
3. Using the destination port (port 23) to infer that the communication is likely Telnet [11](#page=11).
**Example from Frame 1 analysis:** [11](#page=11).
* **Source Port:** `0x0993` = `2451` (decimal) [11](#page=11).
* **Destination Port:** `0x0017` = `23` (decimal) [11](#page=11).
* **Sequence Number:** `0xF2D27A29` = `4073880105` (decimal) [11](#page=11).
* **Acknowledgment Number:** `0x00000000` = `0` (decimal) [11](#page=11).
* **Window Size:** `0x4000` = `16384` (decimal) bytes [11](#page=11).
By analyzing the sequence and acknowledgment numbers across multiple frames, one can reconstruct the order of communication and identify messages exchanged during a Telnet session [10](#page=10) [12](#page=12).
> **Example:** In a Telnet conversation, a sequence number incremented by 1 might indicate a single character being sent, while larger increments could represent commands or data blocks. The acknowledgment numbers confirm receipt of these segments [12](#page=12).
### 3.3 Understanding Telnet conversations
Telnet is an application protocol used for interactive text-based communication over a network. Analyzing TCP segments carrying Telnet traffic involves recognizing port 23 as the destination port and then observing the sequence and acknowledgment numbers to track the back-and-forth exchange of commands and responses. The window size also plays a role in managing the flow of characters and commands during the session [10](#page=10) [11](#page=11) [12](#page=12) [8](#page=8).
> **Tip:** When analyzing Telnet traffic, look for patterns in sequence and acknowledgment numbers. A common pattern is that a client sends a character (incrementing sequence number), and the server acknowledges it and sends back the echoed character (incrementing both sequence and acknowledgment numbers) [12](#page=12).
---
# UDP header interpretation
This section details the process of interpreting a UDP header to extract crucial information about the datagram, including source and destination ports, and its total and payload lengths [6](#page=6).
### 4.1 Structure of the UDP header
The UDP header is an 8-byte segment that precedes the UDP payload. It consists of four 16-bit fields: Source Port, Destination Port, Length, and Checksum [6](#page=6).
#### 4.1.1 Fields and their interpretation
* **Source port:** This 16-bit field indicates the port number of the sending application. It is used by the receiving host to identify the sending process [6](#page=6).
* **Example:** In the hexadecimal sequence `06 32 00 0D 00 1C E2 17`, the source port is `06 32` [6](#page=6).
* **Destination port:** This 16-bit field specifies the port number of the receiving application. It directs the datagram to the correct application on the destination host [6](#page=6).
* **Example:** In the hexadecimal sequence `06 32 00 0D 00 1C E2 17`, the destination port is `00 0D` [6](#page=6).
* **Length:** This 16-bit field indicates the total length of the UDP datagram in bytes, including the header and the payload. The minimum length is 8 bytes, which corresponds to a UDP datagram with only a header and no payload [6](#page=6).
* **Example:** In the hexadecimal sequence `06 32 00 0D 00 1C E2 17`, the total length is `00 1C` [6](#page=6).
* **Checksum:** This 16-bit field is used for error detection. It covers the UDP header, UDP payload, and a pseudo-header from the IP header. While optional in IPv4, it is mandatory in IPv6. If it is zero, it signifies that no checksum was computed [6](#page=6).
* **Example:** In the hexadecimal sequence `06 32 00 0D 00 1C E2 17`, the checksum is `E2 17` [6](#page=6).
#### 4.1.2 Calculating payload length
The data field's length, also known as the payload length, can be calculated by subtracting the size of the UDP header (8 bytes) from the total length of the UDP datagram [6](#page=6).
$$ \text{Payload Length} = \text{Total Length} - 8 \text{ bytes} $$ [6](#page=6).
* **Example:** Given a total length of 28 bytes (`00 1C` hexadecimal) for a UDP datagram, the payload length is $28 - 8 = 20$ bytes [6](#page=6).
> **Tip:** Always remember that the "Length" field in the UDP header refers to the *entire* datagram (header + payload), not just the payload.
### 4.2 Converting hexadecimal to decimal and vice-versa
When interpreting UDP headers presented in hexadecimal format, it is often necessary to convert these values to decimal for easier understanding, especially for port numbers and lengths [6](#page=6).
#### 4.2.1 Hexadecimal to Decimal Conversion
To convert a hexadecimal value to decimal, each hexadecimal digit's positional value is multiplied by the corresponding power of 16.
* **Example:** Convert `0x0632` to decimal [6](#page=6).
* `0x0632` = $(0 \times 16^3) + (6 \times 16^2) + (3 \times 16^1) + (2 \times 16^0)$
* `0x0632` = $(0 \times 4096) + (6 \times 256) + (3 \times 16) + (2 \times 1)$
* `0x0632` = $0 + 1536 + 48 + 2$
* `0x0632` = $1586$ [6](#page=6).
* **Example:** Convert `0x001C` to decimal [6](#page=6).
* `0x001C` = $(0 \times 16^3) + (0 \times 16^2) + (1 \times 16^1) + (12 \times 16^0)$ (where C is 12 in decimal)
* `0x001C` = $0 + 0 + 16 + 12$
* `0x001C` = $28$ [6](#page=6).
> **Tip:** For quick calculations, remember powers of 16: $16^0=1$, $16^1=16$, $16^2=256$, $16^3=4096$.
#### 4.2.2 Decimal to Hexadecimal Conversion
To convert a decimal value to hexadecimal, repeated division by 16 is performed, with the remainders forming the hexadecimal digits from right to left.
* **Example:** Convert decimal 13 to hexadecimal.
* $13 \div 16 = 0$ remainder $13$.
* The decimal remainder $13$ is represented by the hexadecimal digit 'D'.
* Therefore, $13$ decimal is `0D` hexadecimal [6](#page=6).
* **Example:** Convert decimal 28 to hexadecimal.
* $28 \div 16 = 1$ remainder $12$.
* $1 \div 16 = 0$ remainder $1$.
* The remainders from right to left are $12$ (C) and $1$.
* Therefore, $28$ decimal is `1C` hexadecimal. When representing as a 16-bit field, it is padded with leading zeros to `001C` [6](#page=6).
### 4.3 Application in packet analysis
Understanding UDP header interpretation is crucial in network packet analysis for identifying the source and destination applications involved in a communication and for determining the size of the data being transmitted. This knowledge is fundamental for debugging network issues, monitoring traffic, and security analysis [6](#page=6).
---
# ARP protocol interaction
This section analyzes Ethernet frames carrying ARP packets to understand the involved nodes, the type of communication, and its completeness.
### 5.1 Ethernet frame analysis for ARP
Ethernet frames can carry various protocols, identified by the EtherType field. When this field is `0806`, it signifies an Address Resolution Protocol (ARP) packet [12](#page=12) [13](#page=13).
#### 5.1.1 Identifying nodes in ARP communication
To identify the nodes involved in an ARP dialog, both MAC addresses from the Ethernet header and IP addresses from the ARP header are examined [13](#page=13).
* **Ethernet Header Analysis:**
* The destination MAC address indicates where the frame is sent. A destination MAC of `ff:ff:ff:ff:ff:ff` signifies a broadcast to all nodes on the link [13](#page=13).
* The source MAC address identifies the sender of the frame [13](#page=13).
* **ARP Header Analysis:**
* The ARP header contains sender and target IP addresses [13](#page=13).
#### 5.1.2 Type of ARP dialog
The EtherType field `0806` in the Ethernet header confirms that the communication is ARP-based. The ARP header's Operation field further clarifies the specific ARP transaction, such as an ARP request or an ARP response [13](#page=13).
#### 5.1.3 Completeness and order of the ARP communication
A complete ARP transaction typically involves an ARP request and an ARP response. The order is crucial: a node initiates a request to discover the MAC address of another IP address, and the target node responds with its MAC address [13](#page=13).
> **Tip:** A complete ARP dialog establishes the necessary mapping between IP and MAC addresses for communication on the local network segment.
#### 5.1.4 State of nodes before and during ARP dialog
The ARP dialog provides insights into the state of the nodes' ARP tables. If a node sends an ARP request for a specific IP address, it implies that the sender's ARP table does not contain the MAC address for that IP address. The dialog confirms that both nodes are on the same network link [13](#page=13).
#### 5.1.5 Padding in Ethernet frames
Ethernet frames have a minimum length requirement. If the data payload (including the ARP packet) is shorter than this minimum, the frame is padded to meet the required size. This padding ensures that the frame has a valid length before being transmitted on the network [13](#page=13).
> **Example:** In the provided examples, the Ethernet frames are padded because their total length exceeds the sum of the Ethernet header and ARP header sizes [13](#page=13).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Ethernet II frame | A data link layer frame format that includes a destination MAC address, source MAC address, EtherType field, and payload. It is a common standard for local area networks. |
| MAC address | A unique hardware identifier assigned to a network interface controller (NIC) for communications at the data link layer of a network segment. It is typically represented as six groups of two hexadecimal digits. |
| Preamble | A sequence of bits at the beginning of an Ethernet frame that synchronizes the receiver with the incoming data stream. It is typically 7 bytes of alternating 1s and 0s followed by a Start Frame Delimiter (SFD). |
| SFD (Start Frame Delimiter) | A special pattern of bits that follows the preamble in an Ethernet frame, indicating the end of the preamble and the beginning of the actual frame data. |
| CRC (Cyclic Redundancy Check) | An error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data. It is calculated and appended to the frame for verification by the receiver. |
| Hexadecimal format | A base-16 numeral system that uses sixteen distinct symbols, typically digits 0-9 and letters A-F. It is often used in computing to represent binary data in a more compact form. |
| IP packet | A unit of data that traverses an Internet Protocol network. It consists of a header containing addressing and control information, and a data payload. |
| IPv4 | The fourth version of the Internet Protocol, which uses 32-bit addresses to uniquely identify devices on a network. It is the most widely used version of IP. |
| IPv6 | The latest version of the Internet Protocol, designed to replace IPv4. It uses 128-bit addresses, providing a vastly larger address space and improved features. |
| IP header | The control information section of an IP packet, typically containing fields such as version, source IP address, destination IP address, time to live, and protocol. |
| Fragmentation | The process of dividing a large IP datagram into smaller pieces (fragments) to accommodate network links with smaller maximum transmission unit (MTU) sizes. Fragments are reassembled at the destination. |
| Flags (IPv4) | Bits within the IPv4 header that control fragmentation. Key flags include "Don't Fragment" (DF) and "More Fragments" (MF). |
| Identification field (IPv4) | A 16-bit field in the IPv4 header that uniquely identifies a particular fragment of an IP datagram. All fragments of the same datagram share the same identification value. |
| Fragment offset | A 13-bit field in the IPv4 header that indicates the position of a fragment's data within the original, unfragmented datagram. It is measured in 8-byte blocks. |
| UDP (User Datagram Protocol) | A connectionless communication protocol that provides a simple, unreliable datagram service. It is often used for applications where speed is more important than guaranteed delivery. |
| UDP header | A small header for UDP datagrams, containing fields for source port, destination port, length, and checksum. It is 8 bytes long. |
| Source port | A field in the UDP or TCP header that identifies the port number on the sending host from which the datagram or segment originated. |
| Destination port | A field in the UDP or TCP header that identifies the port number on the receiving host to which the datagram or segment is directed. |
| Datagram length (UDP) | A field in the UDP header that specifies the total length of the UDP datagram, including the header and the data payload, in bytes. |
| Payload length (UDP) | The length of the data portion of a UDP datagram, calculated by subtracting the UDP header size from the total datagram length. |
| TCP (Transmission Control Protocol) | A connection-oriented communication protocol that provides reliable, ordered, and error-checked delivery of a stream of bytes. It is widely used for applications like web browsing and email. |
| TCP header | The control information section of a TCP segment, containing fields such as source port, destination port, sequence number, acknowledgment number, data offset, flags, and window size. It is typically 20 bytes long without options. |
| Sequence number (TCP) | A 32-bit field in the TCP header that indicates the byte number of the first byte of data in the current segment, relative to the beginning of the connection's data stream. |
| ACK number (TCP) | A 32-bit field in the TCP header that contains the sequence number of the next byte the sender of the acknowledgment expects to receive. It is used to confirm receipt of data. |
| Data offset (TCP) | A 4-bit field in the TCP header that indicates the size of the TCP header in 32-bit words. This allows for variable-length TCP headers due to the presence of options. |
| Window size (TCP) | A 16-bit field in the TCP header that specifies the number of data bytes the receiver is currently willing to accept. It is used for flow control. |
| Telnet | An application-layer protocol used for interactive text communication over a network. It typically uses TCP port 23. |
| ARP (Address Resolution Protocol) | A network protocol used to map an Internet Protocol (IP) address to a physical machine address that is used under layer. It is used to discover the MAC address associated with a known IP address on the same local network. |
| ARP request | An ARP message sent by a host to discover the MAC address of another host on the network, given its IP address. |
| ARP response | An ARP message sent in reply to an ARP request, providing the MAC address of the requested IP address. |
| Padding | The process of adding extra bytes to a network frame to meet minimum length requirements or to align data. In Ethernet, frames must be at least 64 bytes long. |
| Hop Limit (IPv6) | A field in the IPv6 header that limits the number of routers a packet can traverse before being discarded. It is similar to the Time To Live (TTL) field in IPv4. |
| Payload length (IPv6) | A field in the IPv6 header that specifies the length of the payload in bytes. It does not include the IPv6 header itself. |
| Router hops | The number of intermediate network devices (routers) that a data packet passes through on its way from the source to the destination. |
| Ethernet frame header | The initial part of an Ethernet frame that contains control information, including destination MAC address, source MAC address, and EtherType. It is typically 14 bytes long (excluding preamble and SFD). |
| Router | A networking device that forwards data packets between computer networks. Routers perform traffic directing functions on the Internet. |
Cover
ICT ch5.pptx
Summary
# Understanding the internet and its infrastructure
The internet is a vast, interconnected network of computer networks that facilitates widespread information exchange.
## 1. Understanding the internet and its infrastructure
### 1.1 The internet's fundamental definition
The internet, a short form of "Interconnected Network," is essentially a massive collection of interconnected computer networks. It functions as a network of networks, serving as a powerful tool for global information exchange. Each device connected to the internet is assigned a unique address, known as an IP address, and a computer name.
### 1.2 How the internet works: essential components
For the internet to function, several key components are required:
#### 1.2.1 Connectivity
Connectivity refers to the physical links that connect devices within a network. There are two primary types of internet connectivity:
##### 1.2.1.1 Dial-up connection
Dial-up connection is an older method of accessing the internet that utilizes a telephone line and a modem. This process involves the modem "dialing" a specific phone number to establish a connection with an Internet Service Provider (ISP).
* **How it works:**
* A modem calls a designated number through the telephone line.
* During an active dial-up connection, the telephone line cannot be used for voice calls simultaneously.
* **Components:**
* An account with an ISP.
* A telephone line connection.
* A modem (which can be external or internal).
* Communication software.
* **Speed:** Typically limited to a maximum of 56 kilobits per second (kbps). This speed is insufficient for modern websites, video streaming, or efficient downloads.
* **Features:**
* Uses the Public Switched Telephone Network (PSTN).
* Extremely slow by current standards.
* While inexpensive, it is considered outdated.
* Internet access is unavailable if the phone line is in use.
##### 1.2.1.2 Broadband connection
Broadband connection represents a high-speed internet access method that is perpetually active ("always on") and does not interfere with telephone line usage. This category encompasses various technologies, including DSL, ADSL, Fiber Optic, Cable, and mobile technologies like 4G/5G.
* **How it works:**
* Utilizes digital signals transmitted over telephone lines, fiber optic cables, or wireless signals.
* Most DSL and Fiber connections allow simultaneous internet access and phone calls.
* **Speed:** Significantly faster than dial-up connections:
* DSL: typically ranges from 1 to 20 Megabits per second (Mbps).
* Fiber optic: can range from 50 Mbps to 1 Gigabit per second (Gbps) or higher.
* 4G/5G mobile broadband: speeds can vary widely, from 10 Mbps to 1000 Mbps, depending on network conditions.
* **Features:**
* High-speed and always available.
* Supports demanding online activities such as video streaming, online classes, cloud computing, and gaming.
* Considered reliable and modern.
* **Example Use Cases:** Home internet (Wi-Fi), office networks, fiber optic connections, and mobile data (3G/4G/5G).
#### 1.2.2 Common language (protocols)
Protocols are the rules and standards that govern how devices communicate over the internet. Two crucial protocols are TCP (Transmission Control Protocol) and IP (Internet Protocol).
* **Internet Protocol (IP):**
* Acts as the addressing system for the internet.
* Determines the routing of data packets, specifying where they should go and how they travel between devices.
* When data is sent, IP breaks it into smaller packets, adds source and destination IP addresses to each packet, and routes them through the network.
* At the destination, IP reassembles the packets.
* **Transmission Control Protocol (TCP):**
* Works in conjunction with IP to ensure reliable data transfer.
* Divides data into packets.
* Attaches necessary information to each packet for reassembly at the destination and for error checking.
> **Tip:** Think of IP as the postal system that routes letters to the correct addresses, and TCP as the mail tracker that ensures no letter is lost and all arrive in the correct order.
### 1.3 Internet services
The internet supports a wide array of services, each designed for specific purposes:
#### 1.3.1 World Wide Web (WWW)
The World Wide Web is a vast collection of documents accessible via the internet. These documents can contain text, graphics, audio, and video.
* **Design:** Web documents are typically designed using HyperText Markup Language (HTML).
* **Access:** The web allows users to navigate information non-linearly by clicking on hyperlinks, enabling them to jump between different content.
* **Characteristics:**
* Non-linear navigation.
* Rich media content (video, audio, text, graphics).
* Interactive.
* **Key Internet Terms related to the Web:**
* **Web server:** A program and computer that responds to requests from web browsers.
* **Webpage:** A single document on the World Wide Web.
* **Web browser:** A program that allows users to view and interact with hypertext documents (e.g., Mozilla Firefox, Google Chrome).
* **Homepage:** The initial webpage displayed when a user accesses a website.
* **HTTP (Hypertext Transfer Protocol):** The protocol used by the web to transfer hypertext documents and other internet resources.
* **URL (Uniform Resource Locator):** The complete address of a resource on the internet, specifying its exact location (e.g., `https://www.example.com/about/index.html`).
#### 1.3.2 E-mail (Electronic Mail)
E-mail enables users to send and receive messages, including text, audio, and video clips. It can be used for one-to-one or one-to-many communication and allows for the attachment of large documents.
* **Features:**
* Transmission of text, messages, audio, and video.
* Supports sending to single users or groups.
* Allows attachment of large documents.
* Users can read, print, forward, reply to, or delete messages.
* Significantly cheaper and faster than traditional communication services.
* **Addressing:** Each e-mail user has a unique e-mail address for message delivery.
* **Basic E-mail Terms:**
* **From:** Sender's information.
* **Sent:** Date and time the message was sent.
* **To:** Recipient's address.
* **CC (Carbon Copy):** Sends a copy of the message to additional recipients.
* **Reply:** Responds to the sender of a message.
* **Forward:** Sends a received message to another recipient.
* **Inbox:** Stores incoming mail.
* **Draft:** Stores unfinished emails.
* **Trash:** Stores deleted messages.
* **Sent:** Stores outgoing mail.
#### 1.3.3 FTP (File Transfer Protocol)
FTP is a protocol used to transfer data between computers over the internet. It allows users to send and receive files.
* **Functionality:** Enables downloading files from remote computers connected to the internet.
* **Example Use Case:** Uploading a website to a web server.
#### 1.3.4 Telnet
Telnet is a program that allows users to log into remote computers on the internet, enabling remote computer access.
* **Characteristics:**
* Telnet sessions are text-based, without graphical interfaces.
* Requires knowing the IP address of the remote computer.
* Remote login typically requires specific privileges.
* **Example Command:** `telnet 192.168.1.10`
#### 1.3.5 Usenet
Usenet is a distributed discussion system where millions of users exchange information on a vast array of topics.
* **Difference from E-mail:** Usenet messages are stored on central servers, and users must connect to these servers to read or download messages posted to specific groups. In contrast, e-mail is distributed to individual mailboxes.
#### 1.3.6 Chat & Instant Messaging
Chat programs and instant messaging services allow users to communicate with each other in real-time by typing messages.
* **Examples:** WhatsApp, Facebook Messenger.
#### 1.3.7 Search Engines
Search engines respond to user queries by searching vast indexes of documents and presenting a list of matching results.
* **Examples:** Google, Yahoo.
---
# Internet protocols and addressing
Internet protocols and addressing form the foundational system that enables data to travel across the global network.
### 2.1 The role of the Internet Protocol (IP)
The Internet Protocol (IP) serves as the primary addressing system for the internet. Its core function is to ensure that data packets are correctly routed from their origin to their intended destination.
#### 2.1.1 How IP handles data
When you send information over the internet, such as requesting a webpage or dispatching an email, the Internet Protocol performs several key actions:
* **Packet breakdown:** It divides larger pieces of data into smaller, manageable units called packets.
* **Addressing:** Each packet is augmented with a header that contains crucial information, including the source IP address and the destination IP address.
* **Routing:** IP is responsible for directing these packets across the network, guiding them through various interconnected devices and networks until they reach their target.
* **Reassembly:** At the destination, the packets are reassembled in the correct order to reconstruct the original data.
#### 2.1.2 The relationship between TCP and IP
The Transmission Control Protocol (TCP) and the Internet Protocol (IP) often work in tandem to ensure reliable data transfer.
* **TCP's role:** TCP is responsible for dividing the data into packets and then attaching the necessary information to ensure that these packets can be accurately reassembled at the destination and to check for any errors that may have occurred during transmission.
* **IP's role:** IP then takes these packets and labels them with the appropriate destination address, sending them on their way through the network.
> **Tip:** Think of TCP as the meticulous organizer who carefully prepares and checks each item before it's sent, and IP as the efficient postal service that knows exactly how to deliver each item to its correct address.
### 2.2 IP addressing
Each device connected to the internet is assigned a unique address, known as an IP address, which is essential for its identification and communication within the network.
---
# Common internet services and their applications
This section explores the fundamental services that enable information exchange and interaction across the internet.
### 3.1 Understanding internet connectivity and protocols
The internet is a vast network of interconnected computer networks that facilitates widespread information exchange. Every computer on the internet is assigned a unique address, known as an IP address, and a computer name.
#### 3.1.1 Internet connectivity
Connectivity refers to the physical links that enable devices to communicate on a network. There are two primary types:
* **Dial-up connection:**
* An older method using a telephone line and a modem to connect to an Internet Service Provider (ISP).
* It requires the modem to "dial" a phone number, establishing a connection.
* During a dial-up connection, the telephone line cannot be used for voice calls simultaneously.
* Speeds are typically very slow, often a maximum of 56 kbps.
* This speed is insufficient for modern websites, videos, or large downloads.
* It utilizes the Public Switched Telephone Network (PSTN).
* While cheap, it is considered outdated.
* Internet access is unavailable if the phone line is busy.
* Components include an ISP account, a telephone connection, a modem, and communication software.
* **Broadband connection:**
* A high-speed internet connection that is always on and does not tie up the telephone line.
* Technologies include DSL, ADSL, Fiber Optic, Cable, and mobile broadband (4G/5G).
* It uses digital signals over various mediums like telephone lines, fiber cables, or wireless transmission.
* Most broadband connections allow simultaneous internet use and phone calls.
* Speeds are significantly faster than dial-up, with DSL offering 1–20 Mbps, Fiber optic 50 Mbps – 1 Gbps or more, and mobile broadband ranging from 10 Mbps to 1000 Mbps.
* Key features include high speed, always-on connectivity, and the capability to support demanding applications like video streaming, online classes, cloud services, and gaming.
* Examples include home Wi-Fi, office internet, fiber connections, and mobile data.
#### 3.1.2 Internet protocols
Protocols are essential for the internet to function, acting as the common languages for communication.
* **Internet Protocol (IP):**
* This is the addressing system of the internet, responsible for determining data routing and travel paths between devices.
* When data is sent, IP breaks it into small packets, adds source and destination IP addresses to each packet, routes them through the network, and reassembles them at the destination.
* **Transmission Control Protocol (TCP):**
* Works in conjunction with IP.
* TCP divides data into packets, attaches necessary information for reassembly, and checks for errors to ensure data integrity.
* **Tip:** Think of IP as the postal service that routes letters to the correct address, and TCP as the mail tracker that ensures all letters arrive in order and none are lost.
### 3.2 Major internet services and their applications
The internet offers a variety of services for different purposes:
#### 3.2.1 World Wide Web (WWW)
* The World Wide Web is a vast collection of interlinked documents stored on the internet, containing text, graphics, audio, and video.
* It uses HyperText Markup Language (HTML) to design web documents.
* Users access information non-linearly by clicking hyperlinks, allowing them to jump between content.
* The web is characterized by its rich media content and interactivity.
* **Key WWW terms:**
* **Web server:** A program and computer that responds to requests from web browsers.
* **Webpage:** A single document on the web.
* **Web browser:** A program that allows users to display and interact with hypertext documents (e.g., Mozilla Firefox, Google Chrome, Internet Explorer).
* **Homepage:** The initial webpage displayed when a user accesses a web server or follows a link to it.
* **HTTP (Hypertext Transfer Protocol):** The protocol used to transfer hypertext documents and other internet resources.
* **URL (Uniform Resource Locator):** The complete address of a resource on the internet, specifying its exact location (e.g., `https://www.example.com/about/index.html`).
* **Domain names:** Part of a URL that identifies a specific website or network.
#### 3.2.2 E-mail (Electronic mail)
* Email allows users to send and receive messages, including text, audio, and video clips.
* Messages can be sent to single users or groups.
* Users can attach large documents to their emails.
* Features include reading, printing, forwarding, replying, and deleting messages.
* Email is a significantly cheaper and faster communication method compared to traditional services.
* Each user has a unique email address for message delivery.
* **Basic email terms:**
* **From:** Sender's information.
* **Sent:** The date and time the message was sent.
* **To:** The primary recipient(s) of the message.
* **CC (Carbon Copy):** Sends a copy of the email to additional recipients.
* **Reply:** Sends a response back to the sender (and potentially others).
* **Forward:** Sends an existing email to a new recipient.
* **Inbox:** Stores incoming mail.
* **Draft:** Stores unfinished emails.
* **Trash:** Stores deleted messages.
* **Sent:** Stores outgoing mail.
#### 3.2.3 FTP (File Transfer Protocol)
* FTP is a protocol used to transfer data between computers on the internet.
* It allows users to both send (upload) and receive (download) files.
* **Example Application:** Uploading website files from a local computer to a web server.
#### 3.2.4 Telnet
* Telnet is a program that enables users to log into and control remote computers over the internet.
* It provides remote computer access.
* Telnet sessions are text-based, lacking graphical interfaces.
* To use Telnet, the IP address of the remote computer must be known, and the user typically needs privileges to log in remotely.
* **Example Command:** `telnet 192.168.1.10`
#### 3.2.5 Usenet
* Usenet is a global discussion system where millions of users exchange information on a wide range of topics.
* It differs from email in that Usenet messages are stored on central computers (servers), and users must connect to these servers to read or download messages posted to specific newsgroups. In contrast, email messages are distributed to individual mailboxes.
#### 3.2.6 Chat & Instant Messaging
* Chat programs and instant messaging services allow users to communicate with each other in real-time by typing messages.
* **Examples:** WhatsApp, Facebook Messenger.
#### 3.2.7 Search Engines
* Search engines are tools that respond to user queries by searching vast indexes of documents and displaying a list of relevant results.
* **Examples:** Google, Yahoo.
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Internet | A vast collection of interconnected computer networks that allows for global information exchange. It is essentially a network of computer networks, where each connected device is assigned a unique address. |
| Interconnected Network | A system where multiple independent computer networks are linked together, enabling communication and data sharing between them. |
| IP Address | A unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves as an identifier for routing and addressing. |
| Connectivity | The physical or logical link that allows devices on a network to communicate with each other. It is a fundamental requirement for the internet to function. |
| Dial-up Connection | An older method of connecting to the internet that utilizes a telephone line and a modem. It establishes a connection by dialing a specific phone number to reach an Internet Service Provider (ISP). |
| Modem | A hardware device that modulates and demodulates signals, converting digital data from a computer into an analog signal that can be transmitted over telephone lines, and vice versa. |
| Public Switched Telephone Network (PSTN) | The global network of telephone services that allows for voice calls, and was historically used for dial-up internet connections. |
| Broadband Connection | A high-speed internet connection that is always active and does not tie up the telephone line. It encompasses technologies like DSL, fiber optics, cable, and mobile data. |
| DSL (Digital Subscriber Line) | A technology that provides high-speed internet access by transmitting digital data over traditional copper telephone lines. |
| Fiber Optic | A broadband technology that uses thin strands of glass or plastic to transmit data as light pulses, offering very high speeds and reliability. |
| Internet Protocol (IP) | A set of rules governing the format of data sent over the internet. It is responsible for addressing, packet routing, and ensuring data reaches its intended destination. |
| Packet | A small unit of data that is transmitted over a network. Data is broken down into packets before being sent and reassembled at the destination. |
| TCP (Transmission Control Protocol) | A core protocol of the Internet Protocol suite that provides reliable, ordered, and error-checked delivery of a stream of bytes between applications running on hosts communicating via an IP network. |
| World Wide Web (WWW) | A vast collection of interlinked hypertext documents and resources accessed via the internet. It is a service that uses HTTP to transfer information. |
| HTML (Hypertext Markup Language) | The standard markup language for creating web pages and web applications. It uses tags to structure content and define its appearance. |
| Hyperlink | A reference to data that the user can follow by clicking or tapping. It allows navigation between different web pages or resources. |
| Web Server | A program and computer that stores website files and responds to requests from web browsers, delivering web pages to users. |
| Webpage | A single document accessible on the World Wide Web, typically written in HTML and containing text, images, and hyperlinks. |
| Web Browser | A software application used to access and display information on the World Wide Web. It interprets HTML and other web technologies to render webpages. |
| URL (Uniform Resource Locator) | A web address that specifies the location of a resource on the internet, including the protocol, domain name, and path to the specific file or page. |
| E-mail (Electronic Mail) | A digital messaging system that allows users to send and receive text, audio, video, and attachments over the internet. |
| FTP (File Transfer Protocol) | A standard network protocol used for the transfer of computer files between a client and server on a computer network. |
| Telnet | A network protocol that provides a command-line interface for remotely accessing and controlling other computers over a network. It is primarily text-based. |
| Usenet | A worldwide distributed discussion system that allows users to post and read messages, categorized by topic, on various newsgroups. |
| Search Engine | A software system designed to search for information on the World Wide Web. Users enter keywords, and the search engine returns a list of relevant web pages. |
Cover
InternetRouting2025.pdf
Summary
# Internet and routing fundamentals
This section explores the foundational concepts of the Internet as a network of networks, its evolution with the adoption of TCP/IP, and the principles of local and global routing, including the crucial role of routers.
### 1.1 The evolution of the Internet with TCP/IP
The Internet's transition to the TCP/IP protocol suite on January 1, 1983, marked a significant milestone. This shift introduced key protocols [4](#page=4):
* **IPv4 (Internet Protocol version 4):** Provides host-to-host communication with a "best effort" delivery service, meaning it does not guarantee delivery and is independent of the underlying link-layer protocols [4](#page=4).
* **TCP (Transmission Control Protocol):** Enables reliable process-to-process communication by adding features like error checking and flow control [4](#page=4).
* **UDP (User Datagram Protocol):** Offers process-to-process communication but, like IPv4, provides "best effort" delivery without reliability guarantees [4](#page=4).
### 1.2 The physical and virtual structure of the Internet
The Internet is fundamentally a "network of networks". It comprises interconnected local area networks (LANs) and broader infrastructure [10](#page=10):
* **Home Networks:** Typically include devices like firewalls, routers, wireless access points (WLANs), file servers, Network Attached Storage (NAS), and service servers [5](#page=5).
* **Global Infrastructure:** Characterized by extensive fiber optic cables forming a backbone, emphasizing redundancy for reliability. For example, Sunet CD's backbone operates at 400Gbps [6](#page=6) [7](#page=7).
* **Virtual Networks:** The concept of virtual networks extends to data centers and telecommunication systems, such as LTE networks [8](#page=8) [9](#page=9).
### 1.3 The role of routers
Routers are essential devices that connect different LANs, often with varying Layer 1 and Layer 2 protocols. Their primary functions include [10](#page=10):
* **Interconnecting Networks:** Routers act as the gateways between disparate networks, enabling communication across them [10](#page=10).
* **Breaking Broadcast Domains:** They segment broadcast domains, which is critical because protocols like ARP (Address Resolution Protocol) rely on broadcasts [10](#page=10).
### 1.4 Routing concepts: Intra-domain vs. Inter-domain
Routing within the Internet can be categorized into two main types:
#### 1.4.1 Intra-domain routing
* **Definition:** This refers to routing within a single autonomous system (AS) or administrative domain [10](#page=10).
* **Functionality:** Intra-domain routing focuses on efficiently forwarding packets between nodes within a given network. It helps in breaking broadcast domains [10](#page=10).
#### 1.4.2 Inter-domain routing
* **Definition:** This is routing between different autonomous systems [11](#page=11).
* **Policy Routing:** Inter-domain routing is heavily influenced by policy, where agreements and organizational policies often take precedence over simple connectivity. Key considerations include [11](#page=11):
* Which networks traffic is exchanged with.
* Which networks are permitted to carry one's traffic [11](#page=11).
* **Further Study:** More in-depth details on Inter-Domain Routing are covered in ETSF10 Internetprotokoll [11](#page=11).
### 1.5 Core routing problem: Finding the best path
The fundamental challenge in routing is to determine the "best path" for a packet to reach its destination network. This involves [3](#page=3):
* **Identifying the next hop:** Deciding which neighboring router to send the packet to.
* **Optimizing for the destination network:** Ensuring the path is efficient and aligns with network policies [3](#page=3).
### 1.6 Routing algorithms (Introduction)
The course agenda introduces two primary routing algorithms that will be discussed:
* **Distance Vector:** Algorithms that determine routing paths by having each router communicate its routing table to its neighbors [3](#page=3).
* **Link State:** Algorithms where each router builds a complete map of the network and then computes the shortest path to all destinations [3](#page=3).
### 1.7 Mathematical foundations for routing
Graph theory provides the mathematical framework for understanding and analyzing routing algorithms. Concepts from graph theory are essential for calculating optimal paths and understanding network topology [3](#page=3).
---
# Local routing and address resolution
This section details the mechanisms by which devices on the same network communicate, focusing on the Address Resolution Protocol (ARP) for IPv4 and its IPv6 equivalent, the Neighbor Discovery Protocol.
### 2.1 Local routing principles
Local routing refers to the process of directing datagrams (packets) between devices that are on the same network. The primary decision point for local routing is whether the destination IP address belongs to a device on the same network segment as the sender [13](#page=13) [14](#page=14).
#### 2.1.1 Determining if a destination is on the local network
A sender determines if a destination IP address is on the local network by comparing its own network identifier (Netid) with the destination's Netid. If both the sender and the destination share the same Netid, the destination is considered to be on the local network [14](#page=14).
#### 2.1.2 Routing to a local destination
When the destination IP address is identified as being on the local network, the sender needs to find the destination's MAC address to construct the Layer 2 frame [14](#page=14).
1. **Check ARP cache:** The sender first checks its Address Resolution Protocol (ARP) cache to see if it already has a mapping for the destination IP address to its corresponding MAC address [14](#page=14).
2. **ARP request:** If the destination's MAC address is not found in the ARP cache, the sender initiates an ARP request. This ARP request is typically broadcast to all devices on the local network segment, asking for the MAC address associated with the target IP address [14](#page=14) [17](#page=17).
3. **ARP reply:** The device with the matching IP address responds with an ARP reply containing its MAC address [14](#page=14) [17](#page=17).
4. **Frame construction:** The sender then uses the obtained MAC address to construct the Layer 2 frame and sends the datagram [14](#page=14).
> **Tip:** The switch handles only Layer 2 frames and is unaware of IP addresses; the ARP process is crucial for resolving IP addresses to MAC addresses on the local network [19](#page=19).
#### 2.1.3 Routing to a remote destination (default gateway)
If the destination IP address is *not* on the local network (i.e., it has a different Netid), the sender must send the datagram to its configured default gateway [15](#page=15).
1. **Identify default gateway:** The sender uses its default gateway's IP address as the target for the Layer 2 frame.
2. **Check ARP cache for gateway:** The sender checks its ARP cache for the MAC address of the default gateway [15](#page=15).
3. **ARP for gateway:** If the gateway's MAC address is not in the cache, the sender performs an ARP request specifically for the default gateway's IP address [15](#page=15).
4. **Frame construction:** The sender then constructs the Layer 2 frame using the default gateway's MAC address, even though the ultimate destination IP address is different. The gateway will then handle the routing of the packet to its final destination [15](#page=15).
> **Example:** If a laptop needs to send an IP packet to a server `DatorX` that is not on the same local network, the laptop's ARP request will ask for the MAC address of the router (the default gateway) on the local network, not the MAC address of `DatorX` [19](#page=19).
### 2.2 Address Resolution Protocol (ARP) for IPv4
ARP is a crucial protocol used in IPv4 networks to map an IP address to a physical machine address (MAC address) on the same link layer [14](#page=14).
#### 2.2.1 ARP operation
When a host needs to send an IP datagram to another host on the same logical network, it first determines if the destination host is on the local network by comparing IP addresses and subnet masks. If it is local, the host needs the destination's MAC address. If the MAC address is not in the sender's ARP cache, an ARP request is broadcast. The ARP request contains the IP address of the target and asks for its MAC address. The host with the matching IP address replies with its MAC address [14](#page=14) [17](#page=17).
#### 2.2.2 ARP cache
The ARP cache stores mappings of IP addresses to MAC addresses that have been recently resolved. This caching mechanism improves efficiency by avoiding the need to send an ARP request for every packet sent to a known destination on the local network [14](#page=14).
### 2.3 Neighbor Discovery Protocol (NDP) for IPv6
For IPv6 networks, the functionality provided by ARP in IPv4 is replaced by the Neighbor Discovery Protocol (NDP), which is part of ICMPv6. NDP handles functions such as address resolution, router discovery, and duplicate address detection. It operates analogously to ARP in IPv4, enabling devices on the same IPv6 link to resolve link-layer addresses from IPv6 addresses [16](#page=16).
---
# Global routing principles and graph theory
This section explores fundamental principles of global routing in networks, from basic concepts to advanced graph theory applications for finding optimal paths [20](#page=20) [21](#page=21) [22](#page=22) [23](#page=23) [24](#page=24) [25](#page=25) [26](#page=26) [27](#page=27) [28](#page=28) [29](#page=29) [30](#page=30) [31](#page=31) [32](#page=32) [33](#page=33) [34](#page=34) [35](#page=35) [36](#page=36) [37](#page=37) [38](#page=38) [39](#page=39) [40](#page=40) [41](#page=41) [42](#page=42) [43](#page=43) [44](#page=44) [45](#page=45) [46](#page=46) [47](#page=47) [48](#page=48) [49](#page=49) [50](#page=50) [51](#page=51) [52](#page=52) [53](#page=53).
### 3.1 Routing principles overview
Routing involves directing data packets across networks. The approach to routing can be categorized into three main principles: "no intelligence" (flooding), centralized routing, and distributed routing. Internet Protocol (IP) operates on packet switching, where packets can take different routes and arrive out of order. The sender's IP layer doesn't need to know the exact path or even if the packet will arrive [21](#page=21) [22](#page=22).
#### 3.1.1 "No intelligence" routing: Flooding
Flooding is a routing method where a packet is sent out on all ports or links except for the ingress port it arrived on (#page=23, 28). This ensures that the packet is propagated throughout the network [23](#page=23) [28](#page=28).
##### 3.1.1.1 Problems with flooding
A significant issue with flooding is the potential for packets to loop indefinitely, creating unnecessary traffic. Two common solutions to mitigate this are [28](#page=28):
* **TTL (Time To Live) counter:** A counter decrements with each hop, and the packet is discarded when the counter reaches zero [28](#page=28).
* **Remembering handled packets:** Nodes keep track of packets they have already processed to avoid re-sending them [28](#page=28).
##### 3.1.1.2 Flooding example and exercise
Consider a network graph. The minimum TTL required to ensure all nodes receive a message in a fully connected network is 3 hops. If two links fail, the worst-case scenario requires 5 hops to reach all nodes (#page=29, 30) [29](#page=29) [30](#page=30).
#### 3.1.2 Centralized routing
In centralized routing, the control plane and data plane are separated. A central database and routing algorithm manage network intelligence. Nodes in the network update this central function with their information. Packet forwarding, however, remains distributed. This concept is closely related to Software-Defined Networks (SDN) [32](#page=32).
#### 3.1.3 Distributed routing
With distributed routing, the routing process, encompassing both the control and data planes, is distributed among all routers in the network (#page=33, 34). Two primary methods exist [33](#page=33) [34](#page=34):
* **Distance Vector:** Each node shares its information about the best paths to its neighbors. The end-to-end best path is determined by comparing these updates with all possible next hops. This method is simple and has low demands on processing power and memory [34](#page=34).
* **Link State:** Information about the local topology is flooded to all nodes. Each node then independently calculates the best end-to-end path to all other nodes, typically using a tree-building algorithm. This approach requires more processing power and memory [34](#page=34).
### 3.2 The router and its role
A router is responsible for forwarding packets between networks based on their network layer addresses. Routing decisions are made based on the network identity (net ID), not the host identity (host ID). Routers "learn" the best paths towards a destination's network by exchanging information with other routers within a routing domain. The destination's host ID is only relevant for the final router in the path [35](#page=35).
A router's schematic structure includes input queues, output queues, and a "vägväljar-modul" (path selection module) which makes routing decisions [36](#page=36).
Routing tables are distinct from the forwarding table. Routing tables are maintained by specific routing protocols like OSPF, RIP, and BGP, and they contain information about reachable networks and their paths. The forwarding table, often managed by a Forwarding Table Manager, is a more optimized structure used for rapid packet lookup and forwarding, and can also include static routes [37](#page=37).
#### 3.2.1 Traceroute exercise
The `traceroute` (or `tracert`) command helps determine the path IP datagrams take to a destination. By observing the Round Trip Time (RTT), significant increases can indicate hops over long distances, such as across continents. It's important to note that not all nodes respond to traceroute requests for security reasons [38](#page=38) [40](#page=40).
### 3.3 Graph theory in routing
Graph theory provides a powerful mathematical framework for understanding and solving routing problems, particularly for finding the shortest paths (#page=41, 42) [41](#page=41) [42](#page=42).
#### 3.3.1 Graph fundamentals
A graph is composed of:
* **Nodes (vertices):** Represent entities in the network, such as routers [42](#page=42).
* **Edges (arcs):** Connect nodes, representing links or paths between them [42](#page=42).
Graphs can be:
* **Weighted:** Edges have associated costs, representing metrics like latency, bandwidth, or hop count [42](#page=42).
* **Directed:** Edges have a specific direction, indicating one-way communication or asymmetric costs [42](#page=42).
The concept of a "tree" within a graph is crucial: for any arbitrary graph, there exists a tree that contains the shortest paths from a specific node to all other nodes. The "best" path is defined as the one with the lowest total cost [42](#page=42).
##### 3.3.1.1 Historical context: Euler's bridges
The foundation of graph theory is often attributed to Leonard Euler's solution to the Seven Bridges of Königsberg problem in 1736, which explored the possibility of traversing all bridges exactly once [43](#page=43).
#### 3.3.2 Tree building algorithms
Routing's core objective is to find the best path from a source to all destinations, which is essentially a "tree building" problem in graph theory. Two prominent algorithms for this are [44](#page=44):
* **Bellman-Ford algorithm:** An iterative method that updates distance estimates for all edges in the graph [45](#page=45).
* The algorithm iterates a number of times equal to one less than the number of vertices in the graph [46](#page=46).
* In each iteration, it checks every edge $(u, v)$ and updates the distance to $v$ if a shorter path is found through $u$: $d(v) = d(u) + c(u, v)$, where $d(u)$ is the current cost to reach node $u$, and $c(u, v)$ is the cost of the edge $(u, v)$ (#page=45, 46) [45](#page=45) [46](#page=46).
* If an iteration results in no changes to the distances, the algorithm can terminate early [47](#page=47).
> **Example:** Applying Bellman-Ford from node D in a given graph results in a specific shortest-path tree structure after three iterations [53](#page=53).
* **Shortest Path First (SPF) algorithm (Dijkstra's algorithm):** A greedy algorithm that finds the shortest paths from a single source vertex to all other vertices in a graph with non-negative edge weights (#page=44, 49) [44](#page=44) [49](#page=49).
* It maintains a set of visited nodes and iteratively selects the unvisited node with the smallest known distance from the source [50](#page=50).
* The algorithm then updates the distances of the neighbors of the selected node [50](#page=50).
> **Example:** Applying Dijkstra's algorithm from node A in a given graph leads to the construction of a shortest-path tree, yielding the same final tree structure as Bellman-Ford in some cases (#page=50, 51) [50](#page=50) [51](#page=51).
#### 3.3.3 Exercise on tree building
Given a graph and a starting node (e.g., D), one can calculate the shortest-path tree using both the Bellman-Ford and Dijkstra's SPF algorithms. The results of these calculations should be compared (#page=52, 53) [52](#page=52) [53](#page=53).
---
# Distance vector and link state routing algorithms
This section delves into two fundamental distributed routing algorithms, Distance Vector and Link State, explaining their operational principles, mechanisms for routing table updates, and maintenance processes. [57-66, 68-80
### 4.1 Distance vector routing
Distance Vector (DV) is a distributed routing algorithm where each node periodically exchanges its entire routing table with its directly connected neighbors. The core idea is that each router advertises its knowledge of the best paths to all destinations, including the cost and the next hop. This knowledge is spread "locally" to neighbors, and through these exchanges, global routing information eventually converges across the network [58](#page=58).
#### 4.1.1 Principles of distance vector routing
* **Information Exchange:** Routers send their current routing tables to their neighbors periodically and also whenever a change occurs in their routing information [58](#page=58).
* **Bellman-Ford Algorithm:** The underlying principle for updating routing tables in Distance Vector routing is often based on the Bellman-Ford algorithm [58](#page=58).
* **Routing Table Updates:** Tables are updated when information about new destinations is received, or when the cost or path to an existing destination changes [58](#page=58).
* **Routing Table Structure:** A typical distance vector routing table contains the destination network ID, the cost (often measured in hop count), and the next hop router. The "Next Hop" is the router that sent the vector containing the information [62](#page=62).
#### 4.1.2 Bellman-Ford algorithm for distance vector
The Bellman-Ford algorithm, adapted for distance vector routing, updates a node's cost to a destination based on the costs advertised by its neighbors. If a router `x` learns about a path to destination `y` through neighbor `z` with a cost `c(x,z) + D_{zy}`, it compares this with its current best known cost `D_{xy}` [60](#page=60).
The update rule can be generalized as:
$D_{xy} = \min \{ c_{xz} + D_{zy} \}$ for all neighbors $z$ of $x$ [60](#page=60).
This can also be expressed as:
$D_{xy} = \min \{ D_{xy}, c_{xz} + D_{zy} \}$ [60](#page=60).
It's important to note that $D_{xy}$ can change even if a new node `z` is not directly involved in the path to `y`, but rather a neighbor `z` advertises a better path to `y` [60](#page=60).
The algorithm for updating a routing table at node `x` based on an advertised vector from a neighbor can be described as follows [59](#page=59):
1. If the advertised destination is not in the table, add it.
2. If the advertised destination is already in the table:
a. If the advertised next-hop is the same as the next-hop in the table, replace the entry (e.g., if the cost is updated).
b. If the advertised next-hop is different:
i. If the advertised hop count is less than the hop count in the table, replace the entry.
ii. Otherwise, do nothing.
#### 4.1.3 Distance vector example
Consider a network with routers R1, R2, R3, and R4, and networks A, B, C, and D. Each router periodically sends its routing table (containing network ID and cost) to its neighbors [61](#page=61).
For instance, R1 might have a table:
* Network A: Cost -
* Network B: Cost 1 (Directly connected)
* Network C: Cost 2 (via R2)
* Network D: Cost 3 (via R2)
If R1 sends its table to R2, and R2 has a cost of 4 to reach network D, R2 will update its entry for D. If R2 receives an advertisement from R5 indicating a cost of 5 to reach network D, and R5 is the next hop, R2's table for D might be updated. If R2's current entry for D is a direct connection with cost 5, and it receives an advertisement from R5 with cost 5, it might update its entry to next hop R5 with cost 10 (assuming cost from R2 to R5 is 5) [64](#page=64).
A more structured example of a distance vector table might look like this:
| Destination | Cost | Next Hop |
| :---------- | :--- | :------- |
| Network A | 8 | --- |
| Network B | 4 | --- |
| Network C | 2 | Rtr5 |
| Network D | 5 | --- |
| Network E | 5 | Rtr5 |
| Network F | 7 | Rtr5 |
| Network G | 3 | Rtr5 |
When Rtr3 receives an update from Rtr5, which advertises routes with a cost of 5 from Rtr5:
* If Rtr3's table has `D - 5`, and Rtr5 advertises `D - 5`, Rtr3 might update its entry for D to `D - 10` if Rtr5 is the new next hop with a cost of 5. However, if Rtr3 already has a direct connection for D with cost 5, and Rtr5 is not the preferred next hop, it may not update.
* If Rtr3's table has no entry for C, and Rtr5 advertises `C - 2` with a cost of 5 (meaning `C` is 5 hops from Rtr3 via Rtr5), Rtr3 will add `C - 7 (via Rtr5)` to its table [64](#page=64).
#### 4.1.4 Challenges with distance vector routing
* **Neighbor Discovery:** There isn't a natural mechanism for discovering neighbors [65](#page=65).
* **Failure Detection:** Detecting the disappearance of a neighbor or link can be slow, leading to routing loops or incorrect routing information for a period [65](#page=65).
* **Periodic Updates:** Relying solely on periodic updates can lead to delays in propagating changes [65](#page=65).
### 4.2 Link state routing
Link State (LS) routing algorithms work on the principle that each router constructs a complete map of the network topology. This map is built by flooding "Link State Advertisements" (LSAs) globally throughout the network. Each LSA contains information about a router's directly connected links, their costs, and its neighbors [69](#page=69) [71](#page=71).
#### 4.2.1 Principles of link state routing
* **Global Topology Knowledge:** Each router in the network maintains a database of all known link states [69](#page=69).
* **Link State Advertisements (LSAs):** When a local change occurs (e.g., a link goes up or down), a router generates an LSA describing this change and floods it to all other routers. LSAs are also periodically sent, though much less frequently than in DV routing (e.g., every half hour) [69](#page=69).
* **Shortest Path First (SPF) Algorithm:** Once a router has a complete link state database, it uses an SPF algorithm (like Dijkstra's algorithm) to calculate the shortest path to every other network destination [69](#page=69).
* **Routing Table Updates:** The routing table is updated whenever new information is added to the link state database, triggering an SPF calculation [69](#page=69).
* **Information Flow:** The principle is "local knowledge spreads globally" [69](#page=69).
#### 4.2.2 Link State Advertisement (LSA)
An LSA typically contains:
* **Advertiser:** The ID of the router originating the advertisement [71](#page=71).
* **Network ID:** The identifier of the network or destination being advertised [71](#page=71).
* **Cost:** The cost associated with the link to that network [71](#page=71).
* **Neighbor:** The adjacent router or node connected via this link [71](#page=71).
For routing between a router and a network, the link cost is specified. For routing between a network and a router, the cost is effectively 0 [73](#page=73).
#### 4.2.3 Link State Database example
A Link State database in a router might contain entries like:
| Advertiser | Network ID | Cost | Neighbour |
| :--------- | :--------- | :--- | :-------- |
| Rtr 1 | Net A | 8 | --- |
| Rtr 1 | Net B | 4 | Rtr 2 |
| Rtr 1 | Net B | 4 | Rtr 3 |
| Rtr 2 | Net B | 4 | Rtr 1 |
| Rtr 2 | Net C | 2 | Rtr 4 |
| Rtr 3 | Net B | 4 | Rtr 2 |
| Rtr 3 | Net D | 10 | Rtr 5 |
| ... | ... | ... | ... |
#### 4.2.4 Shortest Path First (SPF) calculation example
To calculate the routing table for Rtr3, an SPF algorithm like Dijkstra's is used on the aggregated link state information.
**Step 1:** Identify the cheapest links originating from Rtr3. If Rtr3 has direct connections to Networks B (cost 4) and D (cost 5), these are marked as permanent [74](#page=74).
**Step 2:** From the set of permanent links, explore outward. For example, if Rtr3 is connected to Rtr2 with cost 4, and Rtr2 is connected to Network C with cost 2, then the path Rtr3 -> Rtr2 -> Net C has a total cost of $4 + 2 = 6$. This path is now considered [75](#page=75).
**Step 3:** Continue this process, iteratively adding the cheapest unvisited node to the permanent set and updating path costs. This process builds up the shortest path tree rooted at the current router [74](#page=74) [75](#page=75) [76](#page=76).
**Step 4:** The final SPF calculation yields the shortest path and cost to all reachable networks. For Rtr3, the routing table might look like:
| Network ID | Next-hop | Cost |
| :--------- | :------- | :--- |
| Net A | Rtr1 | 12 |
| Net B | --- | 4 |
| Net C | Rtr2 | 6 |
| Net D | --- | 5 |
| Net E | Rtr2 | 10 |
| Net F | Rtr2 | 13 |
| Net G | Rtr2 | 13 |
#### 4.2.5 Challenges with link state routing
Similar to Distance Vector, Link State routing also faces challenges in [78](#page=78):
* **Failure Detection:** Detecting link and node failures and how to handle them requires specific mechanisms [78](#page=78).
* **Neighbor Discovery:** Identifying directly connected neighbors is a prerequisite for exchanging LSAs [78](#page=78).
* **Disappearance of Neighbors:** Gracefully handling the event when a neighbor disappears is crucial [78](#page=78).
* **Periodic Updates:** While less frequent than DV, periodic updates are still part of the protocol [78](#page=78).
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Internet | A network of networks, rather than a single unified network, where all participating nodes universally utilize IP protocols for communication. |
| Router | A network device that connects different Local Area Networks (LANs), often supporting diverse Layer 1 (physical) and Layer 2 (data link) protocols, and facilitates communication between these networks. |
| TCP/IP | A suite of communication protocols used for the Internet and similar networks, consisting of the Internet Protocol (IP) for host-to-host communication and the Transmission Control Protocol (TCP) for reliable, process-to-process data transfer. |
| IPv4 | A network layer protocol that provides host-to-host connectivity with a "best effort" delivery service, operating independently of the underlying link protocols. |
| TCP | A transport layer protocol that ensures reliable, process-to-process communication by managing data flow, error checking, and retransmissions. |
| UDP | A transport layer protocol that provides a "best effort", connectionless communication service between processes, prioritizing speed over reliability. |
| Intra-Domain Routing | A type of routing that occurs within a single autonomous system or administrative domain, responsible for breaking down broadcast domains and typically involving protocols like ARP, which broadcast requests. |
| Inter-Domain Routing | A type of routing that occurs between different autonomous systems or administrative domains, where policies and agreements regarding traffic exchange and routing paths take precedence over simple connectivity. |
| Policy Routing | A routing strategy where routing decisions are influenced by administrative policies, agreements on traffic exchange, and who is permitted to carry traffic, rather than solely by network topology or reachability. |
| Backbone Network | A high-capacity network infrastructure that forms the core of larger networks, often designed with significant bandwidth (e.g., 400Gbps) and redundancy to handle substantial data traffic. |
| Local Routing | The process by which devices on the same network segment communicate with each other directly, without needing to pass through a router. This involves determining if the destination IP address resides within the local network. |
| Address Resolution Protocol (ARP) | A network protocol used to discover the link layer address (MAC address) corresponding to a given Internet layer address (IPv4 address) within a local network. It is crucial for devices to be able to resolve an IP address to a MAC address to send data frames. |
| MAC Address | A unique hardware identifier assigned to each network interface controller (NIC) for communications at the data link layer of a network segment. It is used to identify devices on a local network. |
| ARP Cache | A temporary storage maintained by a network device that maps IP addresses to their corresponding MAC addresses. When a device needs to send data to an IP address, it first checks the ARP cache to see if the MAC address is already known. |
| ARP Request | A broadcast message sent by a device on a local network when it needs to find the MAC address of another device on the same network. The request typically asks, "Who has the IP address X? Tell Y (the sender)." |
| ARP Reply | A unicast message sent by a device in response to an ARP request. It contains the MAC address of the device that owns the requested IP address. |
| Network ID | The portion of an IP address that identifies the network to which a device belongs. Devices with the same Network ID are considered to be on the same local network. |
| Datagram | A unit of data transmitted over a packet-switched network. In the context of IP, a datagram refers to an IP packet. |
| Neighbour Discovery Protocol (NDP) | A protocol in IPv6 that serves a similar purpose to ARP in IPv4. It is part of the Internet Control Message Protocol version 6 (ICMPv6) and is used for functions such as address resolution, duplicate address detection, and router discovery. |
| Default Gateway | A router on a local network that serves as the entry point to other networks, such as the internet. When a device needs to send a packet to an IP address outside its local network, it forwards the packet to the default gateway. |
| Global Routing | The process of determining the path for data packets across an entire network, typically involving multiple interconnected networks or autonomous systems. |
| IP Packet Switching | A method where data is broken down into packets, and each packet can take a different route through the network to reach its destination, potentially arriving out of order. |
| Flooding | A routing principle where a packet is sent out on all network interfaces except the one it arrived on, ensuring delivery but potentially causing loops and excessive traffic. |
| TTL (Time To Live) | A mechanism used to prevent packets from endlessly looping in a network; each hop decrements the TTL counter, and a packet is discarded when the TTL reaches zero. |
| Centralized Routing | A routing approach where a single central entity or database holds all routing information and makes decisions for the entire network, separating control and data planes. |
| Distributed Routing | A routing approach where each router independently participates in the routing process, exchanging information with its neighbors to build routing tables and make forwarding decisions. |
| Distance Vector Routing | A distributed routing method where each node shares its current knowledge of the best paths and distances to other nodes with its direct neighbors. |
| Link State Routing | A distributed routing method where each node floods information about its local topology to all other nodes in the network, allowing each node to independently construct a complete network map. |
| Graph Theory | A branch of mathematics that studies graphs, which are abstract representations of networks consisting of nodes (vertices) and connections between them (edges). |
| Graph | A collection of nodes (vertices) and edges (arcs/connections) that link these nodes together. |
| Weighted Graph | A graph where each edge has an associated cost or weight, often representing metrics like latency, bandwidth, or hop count. |
| Directed Graph | A graph in which the edges have a specific direction, indicating a one-way relationship or flow between nodes. |
| Tree Building | A process in graph theory and routing algorithms aimed at finding the shortest path from a source node to all other reachable nodes in a network, forming a shortest-path tree. |
| Bellman-Ford Algorithm | An iterative algorithm used for finding the shortest paths from a single source vertex to all other vertices in a weighted digraph, capable of handling negative edge weights. |
| Shortest Path First (SPF) / Dijkstra's Algorithm | An algorithm that finds the shortest paths between nodes in a graph, typically used in link-state routing protocols; it efficiently calculates the shortest path from a single source vertex to all other vertices in a graph with non-negative edge weights. |
| Vertex (Node) | A fundamental element of a graph, representing a point or entity in the network. |
| Edge (Arc/Connection) | A link or connection between two vertices in a graph, representing a path or relationship. |
| Cost (Weight) | A value assigned to an edge in a weighted graph, representing the expense or difficulty of traversing that connection. |
| Network Topology | The arrangement of the various elements (links, nodes, etc.) of a computer network. |
| Control Plane | The part of a network that is responsible for routing decisions and network management. |
| Data Plane | The part of a network that is responsible for forwarding the actual data traffic based on decisions made by the control plane. |
| Distance Vector | A routing algorithm where each router maintains a routing table that represents the distance (e.g., hop count) to known destinations. Routers periodically exchange their entire routing tables with their direct neighbors, allowing for decentralized updates and propagation of network knowledge. |
| Link State | A routing algorithm where each router advertises its local link status (connections and their costs) to all other routers in the network. Each router then constructs a complete map of the network topology and uses an algorithm like Shortest Path First (SPF) to calculate the best routes. |
| Routing Table | A data structure stored in a router that lists the available routes to various network destinations. It typically includes the destination network, the cost to reach it, and the next hop router or interface to use for forwarding packets towards that destination. |
| Next Hop | The next router in the path to a destination network. When a router receives a packet, it consults its routing table to determine the next hop where the packet should be forwarded to continue its journey towards the final destination. |
| Link State Advertisement (LSA) | A packet used in Link State routing protocols to broadcast information about a router's directly connected links and their associated costs. These advertisements are flooded throughout the network to ensure all routers have an up-to-date view of the network topology. |
| Link State Database | A database maintained by each router in a Link State routing domain. This database stores all received Link State Advertisements (LSAs), effectively building a complete map of the network topology for that router. |
| Shortest Path First (SPF) Algorithm | An algorithm, such as Dijkstra's algorithm, used in Link State routing to calculate the shortest path from a source node to all other nodes in a network. It constructs a shortest-path tree based on the network topology information stored in the Link State Database. |
| Directly Connected | Refers to a network or interface that is directly attached to a router's interface, requiring no intermediate hops. In routing tables, "directly connected" is often indicated by a specific flag or by having the next hop field empty or set to a special value. |
| Hop Count | A metric used in some routing algorithms (like Distance Vector) to measure the distance to a destination. It represents the number of routers a packet must traverse to reach the destination. A lower hop count is generally preferred, indicating a shorter path. |
| Periodical Update | A mechanism in routing protocols where routing information is exchanged between routers at regular time intervals. This ensures that routers receive updated network status even if no immediate change has occurred, helping to maintain routing table consistency. |
| Global Knowledge (Spread Locally) | A characteristic of Distance Vector routing, where each router shares its entire routing table (global knowledge about destinations and costs) only with its immediate neighbors (locally). This local sharing allows the global view to propagate through the network. |
| Local Knowledge (Spread Globally) | A characteristic of Link State routing, where each router shares its local knowledge of its own links and their immediate neighbors. This local information is then flooded globally to all other routers, enabling them to build a complete network map. |
| Routing Metric | A value assigned to a link or path that quantifies its "cost" or desirability for routing. Common metrics include hop count, bandwidth, delay, and load. Routing algorithms use these metrics to determine the best path for data transmission. |
| Convergence | The state of a routing network where all routers have consistent and accurate routing information. During network changes, routing protocols work to reach convergence, ensuring that all routers agree on the best paths to all destinations. |
| Distance Vector Update | The process by which routers running a Distance Vector algorithm exchange and process routing information from their neighbors. This involves comparing received distance vectors with the current routing table and updating entries if a better path is found. |
| Link State Update | The process in Link State routing where changes in network topology, such as link failures or additions, trigger the generation and flooding of Link State Advertisements (LSAs). Upon receiving new LSAs, routers update their Link State Databases and recalculate shortest paths. |
| Advertised Destination | A destination network advertised by a neighboring router in a Distance Vector protocol. This information is used to update the local routing table. |
| Advertised Next-Hop | The next-hop router specified by a neighbor in its advertised routing information. This is crucial for updating the local routing table with the correct forwarding path. |
| Advertised Hop Count | The number of hops to a particular destination as advertised by a neighboring router in a Distance Vector protocol. This value is compared against the current hop count in the local routing table to determine if an update is necessary. |
| Neighbor | A router that is directly connected to another router via a network link. In Distance Vector routing, neighbors exchange routing tables, and in Link State routing, they exchange Link State Advertisements. |
| Cost | A numerical value representing the expense of using a particular link or path. Lower costs are typically preferred in routing algorithms, indicating a more desirable or efficient path. The definition of cost varies depending on the routing protocol and its metrics. |
| Link State Advertisement Advertiser | The router that originates and sends a Link State Advertisement (LSA). This identifies the source of the topological information being broadcast. |
| Link State Advertisement Neighbour | The adjacent router or network that a router advertises a link to in a Link State Advertisement. This indicates the direct connectivity and the associated cost to that neighbor. |
| Routing/Forwarding Table | A table used by routers to make decisions on where to forward incoming IP packets. The routing table informs the forwarding process about the best path to a destination network. In some contexts, the forwarding table is an optimized version of the routing table used for high-speed packet switching. |
| Interface | A network connection point on a router or host. Data packets are sent out from and received into specific interfaces. In routing tables, the interface field indicates which physical or logical port the packet should be sent through to reach the next hop. |
| \(D_{xy}\) | In the context of the Bellman-Ford algorithm, this represents the estimated minimum cost (or distance) from router $x$ to destination $y$. |
| \(c_{xa}\) | In the context of the Bellman-Ford algorithm, this represents the direct cost (or link cost) from router $x$ to an intermediate router $a$. |
| \(D_{ay}\) | In the context of the Bellman-Ford algorithm, this represents the estimated minimum cost (or distance) from an intermediate router $a$ to the destination $y$. |
| \(\min\) | Mathematical operator representing "minimum". Used in routing algorithms to select the path with the lowest cost among several options. For example, \(\min(a, b)\) returns the smaller of $a$ and $b$. |
Cover
MODULE 3.docx
Summary
# Understanding computer networks and the internet
Computer networks and the internet form the backbone of modern global connectivity, enabling a vast array of communication and information-sharing capabilities.
## 1. Understanding computer networks and the internet
A computer network is defined as a collection of interconnected computers that can communicate with each other and share resources, data, and applications. This interconnectivity allows for the seamless exchange of information between two or more computers.
### 1.1 Computer network types
While the document mentions several network types, the primary focus for this topic is on the global scale of the internet and the foundational concepts of networks.
### 1.2 The internet
The internet is a global wide area network (WAN) that connects computer systems across the world. Its fundamental purposes include:
* **Global connectivity:** Linking computer systems universally.
* **Resource sharing and communication:** Enabling users to send, receive, collect, store, update, delete, and manage data and applications.
#### 1.2.1 Capabilities of internet access
Internet access provides users with a broad range of functionalities:
* **Communication:** Sending and receiving electronic mail (email), engaging in social media, and connecting with new people.
* **Information access:** Keeping up with news, shopping online, and learning new skills.
* **Financial management:** Paying bills and managing bank accounts.
* **Entertainment:** Watching television and accessing a multitude of online content.
### 1.3 The World Wide Web (WWW)
The World Wide Web, commonly referred to as the Web, is a vast collection of websites accessible through the internet.
#### 1.3.1 Websites
A website is composed of related text, images, and other resources. Websites can emulate traditional media like newspapers or television programs, or they can offer interactive experiences unique to the digital realm.
**Purposes of a website can include:**
* Serving as a news platform.
* Acting as an advertisement.
* Functioning as an online library.
* Providing a forum for sharing images.
* Serving as an educational site.
* And many other diverse applications.
#### 1.3.2 Web browsers
A web browser is an application software that enables users to access and view websites on the internet. Popular examples include Google Chrome, Internet Explorer, Safari, Microsoft Edge, Opera, and Mozilla Firefox.
#### 1.3.3 URLs and the address bar
A URL (Uniform Resource Locator) is a unique address for a website, also known as an internet address or web address. It functions like a street address, directing your browser to a specific location on the internet. When a URL is entered into the browser's address bar and the "Enter" key is pressed, the browser loads the corresponding web page.
#### 1.3.4 Navigation buttons
Web browsers provide several navigation buttons for user convenience:
* **Back and Forward:** Allow users to move through previously viewed websites.
* **Refresh:** Reloads the current web page.
* **New blank tab:** Opens a new, empty browser tab.
#### 1.3.5 Bookmarks and history
Bookmarks (also known as favorites) and browsing history are essential tools for saving and revisiting websites.
* **Bookmarks:** Allow users to save specific web pages for quick access later. Users can assign a custom name to a bookmark for easier identification.
* **History:** Records all the websites visited, allowing users to find previously accessed pages.
#### 1.3.6 Search engines
Search engines are indispensable tools for finding information on the internet. Some of the most popular search engines include Google, Yahoo!, and Bing.
### 1.4 Electronic mail (Email)
Email, or electronic mail, is a fundamental and widely used feature of the internet, alongside the web.
#### 1.4.1 Functionality of email
The primary function of email is to send and receive messages to and from any individual with an email address.
#### 1.4.2 Email addresses
Every user on the internet has a unique email address, typically following the format: `$username@emailprovider'sdodomain$`.
#### 1.4.3 Email providers
Various email providers offer services, with many professional domains using suffixes other than `.com`. These can include `.gov` for government organizations, `.edu` for educational institutions, and `.org` for non-profit organizations.
#### 1.4.4 Email features
Standard email clients offer several key features:
* **Inbox:** Where received emails are displayed and managed.
* **Sent folder:** Stores all outgoing messages.
* **Message pane:** Allows users to read messages and choose response options like replying or forwarding.
* **Compose pane:** The area where users write new emails, specify recipients, add subject lines, and attach files or images.
### 1.5 Social networking
Social networking platforms are integral to online interaction. Prominent examples include Facebook, Instagram, and Twitter.
### 1.6 Essential concepts of cloud storage
Cloud storage is a model of computing that stores data on the internet via a cloud computing provider. This provider manages and operates data storage as a service.
#### 1.6.1 Cloud storage functionality
Cloud storage enables users to save data and files in an off-site location, accessible through the public internet or a dedicated private network connection.
**Applications of cloud storage include:**
* **File storage:** Users can store various types of information, including files and emails, and access them from any device with appropriate credentials. Popular examples include Dropbox and Google Drive.
* **File sharing:** The cloud simplifies sharing files with multiple individuals simultaneously.
* **Data backup:** Businesses can back up their server data and applications to cloud servers. Services like Carbonite automatically back up data to the cloud.
### 1.7 Effects of IT in society
The impact of Information Technology (IT) on society is multifaceted, with both benefits and drawbacks. These effects are often considered to be roughly equal in magnitude.
**Benefits include:**
* Facilitated communication between individuals.
**Drawbacks can include:**
* Loss of privacy.
* Potential for time wastage.
* Health-related issues.
### 1.8 Network scopes
Networks can be categorized by their geographical scope:
* **PAN (Personal Area Network):** A computer network used on a personal level, typically for transferring small files using wireless technologies like Bluetooth or Infrared (IR). It operates within a very close proximity.
* **LAN (Local Area Network):** A group of computers and peripheral devices connected in a limited area, such as a school, laboratory, home, or office building.
* **MAN (Metropolitan Area Network):** A network that spans a city or a large campus, connecting multiple LANs within that geographical area. It is larger than a LAN but smaller than a WAN.
* **WAN (Wide Area Network):** A computer network that extends over a large geographic area, often connecting multiple LANs across cities or countries. The internet is the most prominent example of a WAN.
---
# Exploring the World Wide Web and web browsing
This section details the World Wide Web, its constituent websites, and the tools used to navigate it, explaining web browsers, URLs, navigation buttons, and the utility of bookmarks and browsing history.
### 3.1 The World Wide Web (WWW)
The World Wide Web, often shortened to the Web, is a vast collection of websites accessible via the Internet. A website itself is composed of interconnected text, images, and other resources, designed to serve various purposes.
#### 3.1.1 Purpose of websites
Websites can function as:
* News platforms
* Advertisements
* Online libraries
* Forums for sharing images
* Educational sites
* And many other applications.
#### 3.1.2 Web browser
A web browser is an essential application software that enables users to access and view websites on the Internet.
#### 3.1.3 URLs and the address bar
* **URL (Uniform Resource Locator)**: This is the unique address for a website, also known as an internet address or web address. It acts like a street address, guiding your browser to the specific location on the Internet you wish to visit. Typing a URL into the browser's address bar and pressing Enter will load the corresponding web page.
#### 3.1.4 Navigation buttons
Web browsers provide several buttons to facilitate navigation:
* **Back and Forward**: These allow users to move through the websites they have recently visited.
* **Refresh**: This button reloads the current page.
* **New blank tab**: This option creates a new, empty tab for browsing.
#### 3.1.5 Bookmarks and history
* **Bookmarks (also known as Favorites)**: These are crucial for saving websites that you wish to revisit. They allow you to store a page with a custom name, making it easily retrievable later.
* **History**: This feature records the websites you have visited, allowing you to access them again, especially if you saved them with a specific name. You can typically find your saved bookmarks and history by accessing the browser's menu (often indicated by three dots) and selecting the relevant option.
> **Tip:** Effectively using bookmarks and history can significantly improve your browsing efficiency and help you keep track of valuable online resources.
#### 3.1.6 Search engines
Search engines are specialized websites designed to help users find information on the World Wide Web. Popular examples include Google, Yahoo!, and Bing.
### 3.2 Email
Email, or electronic mail, is a widely used Internet feature for communication.
#### 3.2.1 Email functionality
The primary function of email is to send and receive messages to and from anyone with an email address.
#### 3.2.2 Email address structure
Every user with an Internet connection has a unique email address, typically structured as:
`username@emailprovider'sdomain`
#### 3.2.3 Email providers and domain suffixes
Email providers manage email services. Many hosted web domains use suffixes other than `.com`. For example:
* `.gov` for government websites
* `.edu` for educational institutions
* `.org` for non-profit organizations
#### 3.2.4 Email features
* **Inbox**: This is where received emails are displayed and managed.
* **Sent folder**: This stores all emails that have been sent.
* **Message pane**: This area allows you to read messages and choose how to respond (reply, forward, etc.).
* **Compose pane**: This is the section where you compose new emails, specifying the recipient's email address, subject, and the message content. It often includes options to attach files or insert images.
### 3.3 Social Networking
Social networking platforms are online services that facilitate social interaction and connection between people. Prominent examples include Facebook, Instagram, and Twitter.
### 3.4 Cloud Storage
Cloud storage is a model within cloud computing that allows data to be stored on the Internet via a cloud computing provider.
#### 3.4.1 How cloud storage works
This model permits you to save data and files in a remote location accessible through the public Internet or a dedicated private network connection.
#### 3.4.2 Cloud storage applications
Cloud storage offers several key applications:
* **File storage**: Users can store various types of information, including files and emails, and access them from any internet-connected device. Examples include Dropbox and Google Drive.
* **File sharing**: The cloud simplifies the process of sharing files simultaneously with multiple individuals.
* **Data Backup**: Businesses can back up their data and applications from on-premises servers to cloud servers, ensuring data redundancy and disaster recovery. Services like Carbonite automate this process.
> **Example:** A student can upload all their lecture notes, assignments, and research papers to a cloud storage service like Google Drive, allowing them to access these files from their laptop, tablet, or phone, and also easily share them with classmates for group projects.
---
# Email and social networking functionalities
This section delves into two fundamental internet services: electronic mail (email) and social networking platforms, exploring their structure, features, and applications.
### 3.1 Electronic mail (email)
Email, or electronic mail, stands as one of the most extensively utilized features of the internet, paralleling the popularity of the World Wide Web. It facilitates the sending and receiving of messages between individuals who possess an email address.
#### 3.1.1 Email address structure
Every user of the internet is allocated a unique email account. The standard format of an email address is structured as follows:
`username@email_provider's_domain`
Where:
* `username`: This is the unique identifier for the user.
* `@`: This symbol separates the username from the provider's domain.
* `email_provider's_domain`: This signifies the domain name of the email service provider.
#### 3.1.2 Email providers
Email providers are companies or organizations that offer email services. While many popular providers offer free services for personal use, professional settings may utilize more specialized providers. For businesses and organizations, domain suffixes can vary. Common suffixes include:
* `.gov`: Used for government websites.
* `.edu`: Used for educational institutions.
* `.org`: Used for non-profit organizations.
#### 3.1.3 Key email features
Email clients typically offer several essential features to manage communication:
* **Inbox:** This is the primary location where users can view and organize all incoming emails.
* **Sent folder:** This folder stores all emails that have been sent by the user, allowing for easy retrieval and reference.
* **Message pane:** This area displays the content of a selected email, enabling users to read the message and interact with it. It provides options for various responses, such as replying or forwarding.
* **Compose pane:** This is the dedicated section for creating new emails. It includes fields for the recipient's email address, the subject line, and the body of the message. It also typically offers functionalities for replying, forwarding, and attaching files, including images.
### 3.2 Social networking
Social networking platforms are online services that enable users to create profiles and connect with other users. They have become a significant aspect of internet usage, facilitating communication and interaction on a global scale.
#### 3.2.1 Examples of social networking platforms
Popular examples of social networking platforms include:
* Facebook
* Instagram
* Twitter
---
# Cloud storage and its societal impact
Cloud storage is a crucial component of modern digital infrastructure, enabling data to be stored and accessed remotely, with significant implications for individuals and society.
### 4.1 Understanding cloud storage
Cloud storage is a service model within cloud computing that allows for the storage of data on the internet through a provider who manages and operates data storage infrastructure. This means that data and files are kept in a location external to the user's own devices, accessible via the public internet or a dedicated private network connection.
### 4.2 Applications of cloud storage
Cloud storage offers a range of applications that enhance data management and accessibility.
#### 4.2.1 File storage
Users can store various types of information in the cloud, including documents, media files, and even emails. This stored data can be accessed from any device with an internet connection, provided the user has the necessary authorization.
> **Example:** Services like Dropbox and Google Drive are prominent examples of cloud storage solutions that allow users to store and organize a wide array of digital files.
#### 4.2.2 File sharing
The cloud significantly simplifies the process of sharing files with multiple individuals simultaneously. This capability is vital for collaboration in both personal and professional contexts.
#### 4.2.3 Data backup
Cloud storage serves as a robust solution for data backup. Businesses can back up their data and applications from their servers to a cloud server, ensuring data resilience and recovery in case of local hardware failure or other emergencies.
> **Example:** Services like Carbonite specialize in automatically backing up user data to the cloud.
### 4.3 Societal impact of IT and cloud storage
Information Technology (IT), including cloud storage, has a profound and multifaceted impact on society, presenting both advantages and disadvantages.
#### 4.3.1 Benefits of IT
* **Enhanced communication:** IT has greatly facilitated communication between individuals, breaking down geographical barriers.
* **Accessibility of information:** Services like the World Wide Web provide vast resources for learning, news, and entertainment, accessible from almost anywhere.
* **Streamlined services:** Online platforms enable efficient management of personal affairs such as bill payments and banking.
#### 4.3.2 Drawbacks of IT
* **Privacy concerns:** The widespread collection and storage of data can lead to concerns about individual privacy and data security.
* **Time consumption:** Excessive use of online platforms can sometimes lead to time wastage.
* **Health issues:** Prolonged engagement with digital devices can contribute to various health problems.
The benefits and drawbacks of IT's impact on society are often considered to be in a delicate balance. Cloud storage, as a key enabler of many IT services, therefore shares in these societal implications.
---
# Classifications of computer networks
This section categorizes computer networks based on their geographical scope, detailing Personal Area Networks (PAN), Local Area Networks (LAN), Metropolitan Area Networks (MAN), and Wide Area Networks (WAN).
### 5.1 Network types by geographical scope
Computer networks can be classified into distinct categories based on the geographical area they cover. This classification helps in understanding the scale, purpose, and technological requirements of different network types.
#### 5.1.1 Personal Area Network (PAN)
A Personal Area Network (PAN) is a computer network used on a personal level. It is generally employed for transferring small files and utilizes wireless technologies such as Bluetooth and Infrared (IR).
> **Tip:** PANs are designed for short-range communication, typically within a few meters, connecting devices around an individual.
#### 5.1.2 Local Area Network (LAN)
A Local Area Network (LAN) is a group of computers and peripheral devices that are connected within a limited area. This includes locations like schools, laboratories, homes, and office buildings. LANs provide high-speed connectivity for a localized set of users.
> **Example:** The network connecting computers within a single office floor or a university department is a typical example of a LAN.
#### 5.1.3 Metropolitan Area Network (MAN)
A Metropolitan Area Network (MAN) is a computer network that connects multiple LANs across a large geographical area, but is smaller than a WAN. It typically spans an entire city, a large college campus, or a small region. MANs often provide high-speed connectivity and can be owned and operated by a single organization or by a consortium of organizations.
> **Tip:** MANs are often used by organizations with multiple branches within a city or by internet service providers to connect users across a metropolitan area.
#### 5.1.4 Wide Area Network (WAN)
A Wide Area Network (WAN) is a computer network that extends over a large geographical area. It is also referred to as the connectivity of multiple LANs. WANs can span across countries or even continents, facilitating communication and resource sharing over vast distances. The Internet itself is the largest example of a WAN.
> **Example:** A company with offices in different cities or countries would use a WAN to connect its various locations.
---
## Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
Glossary
| Term | Definition |
|------|------------|
| Computer Network | A collection of computers linked together allowing them to connect, communicate, and share resources, data, and applications. |
| Internet | A global wide area network that connects computer systems across the world, enabling users to send, receive, collect, store, and manage data. |
| World Wide Web (WWW) | A collection of websites accessible through the Internet, where each website comprises related text, images, and other resources. |
| Website | A collection of related text, images, and other resources that can resemble other media forms or be interactive, serving purposes like news platforms, advertisements, or educational sites. |
| Web Browser | An application software used to access and view websites on the Internet, acting as an interface to retrieve web content. |
| URL (Uniform Resource Locator) | A unique address for a website, also known as an internet address or web address, which guides a web browser to a specific location on the Internet. |
| Bookmarks | A feature that allows users to save specific websites for easy revisiting, typically stored with a user-defined name for quick access through browsing history. |
| History | A record of all the websites a user has visited, allowing them to easily find and return to previously accessed pages. |
| Search Engine | A tool used to search for information on the World Wide Web, with popular examples including Google, Yahoo!, and Bing. |
| Email (Electronic Mail) | A widely used internet feature for sending and receiving messages to and from individuals with an email address. |
| Email Address | A unique identifier for an email account, typically in the format username@email_provider's_domain. |
| Inbox | The designated area within an email client where received emails are stored and can be viewed and managed. |
| Compose Pane | The section of an email client where users write new emails, including specifying recipients, subject lines, and composing the message body, with options for attachments and formatting. |
| Cloud Storage | A cloud computing model where data is stored on the Internet through a provider who manages storage as a service, allowing access from various devices via the internet. |
| File Storage | The capability within cloud storage to store diverse types of information, including files and emails, making them accessible from multiple devices. |
| File Sharing | The functionality of cloud storage that simplifies the process of distributing files to multiple individuals simultaneously. |
| Data Backup | The process of backing up and storing data and applications from business servers onto a cloud server for safety and recovery. |
| PAN (Personal Area Network) | A computer network used on a personal level, typically for transferring small files and employing wireless technologies like Bluetooth or IR within a very close proximity. |
| LAN (Local Area Network) | A group of computers and peripheral devices connected within a limited geographical area such as a school, laboratory, home, or office building. |
| MAN (Metropolitan Area Network) | A computer network that connects multiple LANs across a large area but is smaller than a WAN, typically spanning an entire city, college campus, or small region. |
| WAN (Wide Area Network) | A computer network that extends over a large geographical area, often formed by the connectivity of multiple LANs across cities or countries. |