Sei sulla pagina 1di 19

COMPUTER NETWORKS

I PARTIAL EXAM
Chapter 1: Computer networks

1. Network hardware
There are two types of transmission technology that are in widespread use:
broadcast links and point-to-point links.
Point to point links connect individual pairs of machines. Short messages
called packets are sent, and they visit one or more intermediate
machines, often multiple routers. It is sometimes called unicasting.
Broadcast networks, its channel is shared by all the machines of the
network and all of them receive every information that is sent. An
address filled in each packet is checked, if the machine recognizes its own
address it opens the file. If not, it is ignored. A wireless network is a
common example for this. Broadcast systems usually also allow the
possibility of addressing a packet to all destinations by using a special
code in the address field. When a packet with this code is transmitted, it
is received and processed by every machine on the network. This mode
of operation is called broadcasting. Some broadcast systems also support
transmission to a subset of the machines, which known as multicasting.
An alternative criterion for classifying networks is by scale:
o Personal Area Networks (PAN) lets devices communicate over a
range of a person. (Blutooth)
o Large Area Networks (LAN) a privately owned network that
operates within and nearby a single building like a home, office or
factory. (WIFI router. WIFI = IEEE 802.11; Ethernet = IEEE 802.3)
o Metropolitan Area Network (MAN) covers a city.
o Wide Area Network (WAN) spreads a large geographical area
often a country or continent. Computers of running (application)
programs are called hosts, the rest of the network that connects
these hosts is called subnet. The subnet consists of:
Transmission lines move bits between machines. Made
of copper wire, optical fiber, radio links.

Switches specialized computers that connect two or


more transmission lines.
How the network makes the decision as to which path to
use routing algorithm
How the router makes the decision of which path to use
forwarding algorithm.

Internetworks - Many networks exist in the world, often with


different hardware and software. People connected to one network
often want to communicate with people attached to a different one.
The fulfillment of this desire requires that different, and frequently
incompatible, networks be connected. A collection of interconnected
networks is called an internetwork or internet.
2. Network software
Protocol Hierarchies
o To reduce their design complexity, most networks are organized as a
stack of layers.
o Protocol an agreement between the communicationg parties on how
communication is to proceed.
o Peers the entities comprising the corresponding layers on different
machines.
In reality no data is transferred directly from one layer to another. Instead, each layer passes
data and control information to the layer immediately below it, until the lowest layer is
reached. Below layer 1 is the physical medium though which actual communication occurs.
Between each pair of interface of adjacent layers is an interface (it decides which primitive
operations and services the lower layer makes available to the upper one).
o A set of layers and protocols is called a network architecture.
Five layer ex.
A message M is produced by the application layer and passed to the transport layer
that adds a header h in front of the message. The header includes control information, such as
source and destination addresses. Now it is called a segment. Passing it on to the network layer
who also adds a header and breaks the message into packets. Now its called a packet
(datagram) and passing it to the link layer, while adding a header is called a frame. The frame is
passed to the physical layer, whose duty is to translate the frame into zeros and ones, and
transmit it to the destination machine. On the destination part it all done the same but vice
versa.
3. ISO OSI (Open System Interconnection) Reference model:

I.

Designed for better communication. It has 7 layers. (Application, Presentation,


Session, Transport, Network, Data link, Physical)
Physical layer L1
Moves bits between physically connected end systems. The standards define:
Coding schemes for bit representation
Connectors shapes and sizes
Bit level synchronization

Internet: Technologies for moving bits over wired, wireless, satellite and other types of links.
II.

Data layer L2
Reliable communication over a given link. Introducing the concept of frame (A set of bits
that belong together). Idle no frame markers. Begin and end start/end frame
makers. Data layer protocols are the first software layer. Very dependent on the
physical link characteristics. Usually physical and data layer are grouped together in the
hardware. Internet: Multiple different data protocols, most common is the Ethernet
(others FDDI, SONET). Ethernet (broadcast link): the system must receive only bits that
are meant for it. Data layer addresses are required.

III.

Network layer L3
Transfers data from source to destination. Logically connects a set of links in order to
form a path abstraction. Enables the end system to communicate with another end
system by calculating a route between two. Hides the characteristics of the specific data
layer. Enables the definition of a unique network address. Can be found in the end
systems and the intermediate systems.
In datagram networks: provides routing and data forwarding.
In connection-oriented networks: separate data and control plane. The data plane
forwards and reorders data (deals with each data byte). The control plane is responsible
for routing, call establishment, call establishment, call ending (doesnt work with the
data). Internet: The network layer is provided with IP. Can be found in all intermediate
systems. Provides path abstraction. Segment and reassembly. Packet-forwarding and
routing. Unique IP address. Can be used as a layer on top of anything, but its just a besteffort service. At the routers: Part of the routing protocol that creates the routing
tables. Responsible for packet forwarding. Defines the packet transmission order.
Decides which packets are going to be dropped. At the hosts: Primarily hides the
details from the data layer. Segmentation and reassembly. Error detection.

IV.

Transport layer L4
Reliable end-to-end communication. Creates an abstraction of error-controlled, flowcontrolled & multiplexed end-to-end link. Some transport layers offer less services
(simple error detection, no flow control, no retransmissions). Internet: TCP
(Transmission Control Protocol) provides error-control, flow-control & multiplexing. UDP

(User datagram protocol) provides only multiplexing. Connection-oriented &


connectionless services ((Reliable message stream, Reliable byte stream, Unreliable
connection), (Unreliable datagram, Acknowledged datagram, Request-reply)). 5 service
primitives in order to provide a simple connection-oriented service (LISTEN, CONNECT,
RECEIVE, SEND, DISCONNECT). Error control: The message will get too the destination
no matter if there is a packet loss, errors or duplication. Actions are to retransmit lost
packets, detection, discarding and retransmission of corrupted packets, detection and
discarding of duplicate packets. Flow control: Matching the transmission speed with the
available speed along the route and at the destination. Multiplexing: adds an application
specific id (port number) so that the receiving end system can deliver the received
packet to the right application.
V.

Session layer
Not common. Provides: full-duplex service (provides dialogue control for half-duplex
applications, or applications that need to send or receive data), expedited data delivery
(enables some messages to move faster through the queues, using separate low delay
end points at the transport layer) & synchronization (enables the end users to place
markers in the data stream and go back to a given marker). Internet: No standard
session layer.

VI.

Presentation layer
Usually ad hoc. Works with application data (unlike the other layers that work with the
headers and dont touch the data). Hides the difference in the data representation
between the communicating applications (char encoding). Can encrypt the data.
Internet: No standard presentation level. Only defines the network byted order for 2- &
4- byte integers.

VII.

Application layer
Set of applications that use the network in order to exchange information. Doesnt
provide services for layers.

Chapter 2: Data transmission

1.

2.

3.

4.

The simple communication model is represented by two users A and B. A sends a


message. The message is encoded into a signal and travels through the channel where
noise is also present. On the other side the signal is decoded and the message is
received by B.
Terminology
Guided media wired
o Point-to-point:
Simplex (Transmitted in only one direction, A is transmitter and B
is receiver)
Half-duplex (Both stations may transmit, but only one at a time)
Full-duplex (Both stations may transmit simultaneously. The
medium is carrying signals in both directions at the same time.
Unguided media wireless
Analog signal - one in which there are no discontinuities in the signal
Digital signal one in which the signal intensity maintains a constant level for
some period of time and then abruptly changes to another constant level.
Analog and digital data transmission
Data information.
Signals electric or electromagnetic representation of data.
Signaling physical propagation of the signal along a suitable medium.
Transmission the communication of data by the propagation and
processing of signals.
Transmission impairments
This occurs when the received signal is not the same as the sent signal. The quality
of the analog signals is changes and for the digital signal 0 > 1 or 1 >0. The most
significant impairments are:
Attenuation
Delay Distortion
Noise
Channel capacity The max rate at which data can be transmitted over a given
communication path under given conditions.
Data rate the rate in b/s (bits/sec) at which data can be communicated.
Bandwidth the bandwidth of the transmitted signal as constrained by the
transmitter and the nature of transmission medium, expressed in Hz (cyc/sec).
Noise the average level of noise over the communication path
Error rate the rate at which errors occur, where an error is the reception of 1
when a 0 was transmitted or the reception of 0 when a 1 was transmitted.

5. Nyquist bandwidth If the rate of signal transmission is 2H, than a signal with
frequencies no greater than H is sufficient to carry the signal rate.
V Number of levels
= 22
6. Shannon capacity When we take noise into consideration
N Noise power
D channel capacity
S Signal power
H bandwidth

= 2 (1 + )

( ) = 1010

7. Digital data to digital signal


NRZ-L
o 0 = high level
o 1 = low level
NRZI
o 0 = stay same
o 1 = invert
Bipolar-AMI
o 0 = neutral
o 1 = high to low neizmenicno
Pseudoternary
o 0 = high to low neizmenicno
o 1 = neutral
Manchester
o 0 = high to low
o 1 = low to high
Differential Manchester
o 0 = replicate
o 1 = mirror
8. Digital data to analog signal
Modulation techniques
o Amplitude shift keying (ASK)
() = {

(2),
0,

1
0

o Frequency shift keying (FSK)


() = {

(21 ),
(22 ),

1
0

o Phase shift keying (PSK)


() = {

(2)
(2),
={
(2 + )
(2),

1
0

9. Analog data to digital signal


Digitalization using a digitizer. The analog
signal is sampled in time and then we take
discrete values of the amplitude. The quantified
samples are turned into a binary number.

10.

Analog data to analog signal


Amplitude modulation (AM)
Frequency modulation (FM)
Phase modulation (PM)

Chapter 3: Data link layer


1. Sending signals over a transmission link, for effective digital data communication. To
achieve the necessary control, a layer of logic is added above the physical layer aka data
link control/data link control protocol/data link. Data are send in blocks called frames.
The beginning and end of each frame must be recognizable (frame synchronization).
The sending station mustnt send frames at a rate faster that the receiving station can
absorb them (flow control). Bit errors introduced by the transmission system should be
corrected (error control). On a shared link, such as a LAN, the identity of the two
stations involved in a transmission must be specified (addressing). The receiver must be
able to distinguish control information from the data being transmitted (control and
data on same link).
2. Flow control
Enables the receiver to regulate the data flow from the sender s.t the
receiver buffer will not overflow. There are two types of flow control:
1) Flow control with feedback, 2) Flow control with flow measurements.
Stop and wait:
o Sender sends a frame
o Receiver receives the frame and sends ACK
o Sender waits for an ACK before it sends the next frame
o Receiver can stop the communication if it doesnt send ACK
o Works well for small number of big frames
Fragmentation:
o Big data blocks can be divided into smaller frames
Limited buffer size at the receiver
Early error detection (before the full data block is
received)
If error is detected, the corrupted frames are resent (less
data for resending)
o Stop and Wait becomes inadequate solution
Sliding window flow control
o Sender can send W frames without waiting for ACK (N packets)
o Each frame has a sequence number
o When the receiver sends ACK, it contains the next sequence
number of the frame expected (ACK OK, send me N+1 )
o The sequence numbers set is limited by the field size in the frame
header (k)
All sequence numbers are modulo 2^k
o Receiver can stop the frame by sending RNR (Receiver Not Ready)
o RNR acknowledges all previous frames, but forbids new

o
o

For the flow to continue, the receiver needs to send RR


On a duplex link, piggybacking is used
If the station wants to send data and ack, it sends them
both in one frame
If the station wants to send ack, with no data, it sends a
separate ack frame: RR or RNR
If the station wants to send data, with no ack, it must reack the sequence number of the last sent ack
The duplicate ack is dropped at the receiver

Frame transmission with error control


o Lost frame Noise burst can destroy the frame and the receiver
cant detect it
o Corrupted frame Some of the frame bits are modified
3. Error control Automatic Repeat Request (ARQ)
Mechanisms
o Error detection
o Positive ack Receiver sends positive ack for a successfully received
frame
o Timeout retransmission Sender resends the frame for which he has not
received ack after a certain predefines time period
o Negative ack and retransmission Receiver sends negative ack for a
corrupted frame. The sender resends the frame
o The unreliable link is turned into a reliable link:
Stop and wait ARQ (Pro: Simple, Cons: Inefficient)
i. Sender sends a frame and sets a timer
ii. Sender waits for ACK before he sends another frame
If the received frame is corrupted, it is discarded. After a timeout
at the sender, the frame is resent again. The frame must be
buffered.
If the ACK is corrupted, it is not recognized at the sender. Sender
resends the frame. Receiver has two copies of the same frame.
ACK0 & ACK1 are used. ACK0 signifies that the receiver is ready to
accept frame 0.
Go back N
i.
Based on sliding window
ii.
Frame is OK, send ACK with the sequence number of the following
frame

iii.

The number of unACK received frames is defined with the window


size.

Corrupted frame:
i.
ii.
iii.
iv.

Receiver detect error in frame i


Receiver sends REJ-i
Sender receives REJ-i
Sender resends frame I and all frames sent after

Lost frame:
i.
ii.
iii.
iv.
v.

Frame i is lost
Sender sends frame i+1
Receiver receives frame i+1 out of order
Receiver sends REJ i
Sender resends frame I and all following frames

i.
ii.
iii.
iv.

Frame i is lost and no new frames are sent


Receiver receives nothing, doesnt send RR nor REJ
After time out at the sender, a RR frame with P-bit set to 1 is send
Receiver interrupts this frame as a command to reply with RR that points the
expected frame i
Sender resends frame i

v.
i.

Receiver received frame I and sends ACK(i+1), that is lost in transmission


a. ACK are cumulative, it is possible that the sender will receive ACK(i+n)
before timeout for frame i
b. If timeout occurs, sender sends RR with P-bit set command (This
procedure can be repeated several times before restart is initiated).

Selective-reject (selective resend)


o Only the frames for which a SREJ is received or timeout occurred, are
resent
o Frames that are part of the receivers window are buffered
o Minimizes the number of resent frames
o Receiver must have a large enough buffer
o Complex logic at the sender
Must place a limit on the window size
i. Max window size is 7
ii. Sender sends frames 0 to 6

iii.
iv.
v.
vi.
vii.

Receiver receives all frames and sends RR7


RR7 is lost
After timeout for frame0, frame0 is resent
Receiver moved its window to 7,0,1,2,3,4,5
Receiver thinks that frame 7 is lost and frame0 is new
frame and buffers it
The max window size cant be greater than half the total number
of sequence numbers.
4. High Level Data Link Control HDLC (One of the most important control protocols)
a) HDLC station types
Primary station:
- Controls the link
- Creates command frames
- Has a logical link to each secondary station
Secondary station
- Controlled by the primary station
- Creates response frames
Combined station
- Can create commands and responses
b) HDLC link configuration
Unbalanced
- One primary and one or more secondary stations
- Supports full-duplex and half-duplex transmission
Balanced
- Two combined stations
- Supports full-duplex and half-duplex transmission
c) HDLC data transmission
Normal Response Mode NRM
- Secondary station can send data as a response to a command
from the primary station
Asynchronous Balanced Mode ABM
- Any combined station can initiate data transfer without
permission
Asynchronous Response Mode ARM
- Secondary station can initiate transmission without permission
from the primary station

Frame format:

Flag fields:

Begin and end frame 01111110


Receiver always searches for the flag in order to synchronize the beginning of the frame
Bit stuffing is used

Address:

Identifies the secondary station that sent or will receive a frame


Usually 8 bit long frame
Can be extended
11111111 is broadcast address

Control field:

Different format for different frames


o I-frames data for upper layer (Flow control and error control data
o S-frames ARQ when no piggybacking is used
o U-frames additional functions for link control

Poll/Final (P/F) bit:

Context dependent
Command frame
o P bit
o 1 = poll
Response frame
o F bit
o 1 = response to a command

Information field:

Integer number of 8 bit strings


Only at I-frames and some U-frames
Variable length

Field Check Sequence Field FCS

Error detection
Usually 16 bit CRC, optionally 32 bit CRC

HDLC:

I-frames, S-frames & U-frames exchange between two stations


Three phases
o Initialization: (NRM, ABM, ARM), seq. no. size
o Data transmission
o End connections
5. Framing 4 methods
Character count (The header contains the frame length)
Byte stuffing (The frame begins and ends with FLAG bytes, and ESC is
added
Bit stuffing (Each frame starts and ends with a FLAG byte. Use bit stuffing
s.t the flag does not appear in the middle of the frame n-1)
Physical layer coding violations

Error detection & error correction codes:


I Error detection (Add additional r bits = error detection code)
1. Parity bit
2. CRC
II Error correction (Used for wireless communication)
1. Hamming code
2. PPP (point to Point Protocol)

Chapter 4: LAN technologies


MAC sublayer
1. Random access protocols
When a station wants to send data: It transmits with max data rate R
If 2 or more stations transmit -> COLLISION
Random access MAC protocols:
o ALOHA, slotted ALOHA (digital)
o CSMA, CSMA/CD, CSMA/CA
Pure ALOHA:

When the station has a frame to send, it sends the frame, but frames can collide
inside the interval.
1/(2e) is the efficiency

Slotted ALOHA:

Station can send a new frame in the next slot no collision (simple)
Station retries to send the frame in the next slot with probability p, until it is
successful collision (lost slots, clock synchronization)
1/e efficiency

Protocols in which stations listen for a carrier and act accordingly are called carrier sense
protocols.
CSMA (Carrier Sense Multiple Access):
CSMA:
Sense the channel before transmitting
If the channel is free, send the frame
If the channel is busy, deter from transmission
Analogy: do not interrupt the others!
But, collisions can occur, because of the propagation time, two stations cant sense the
transmission. The transmission time for the complete frame is wasted. The distance and
propagation delay affect the collision probability.
CSMA/CD (Collision Detection)

Sense the channel, deter from transmission as for CSMA. Collisions are detected
after a short time period. Upon detection, the transmission is aborted in order not
to waste the channel. It is easy in wired LAN, but difficult in wireless LAN.

Wireless LAN Protocols:

Before starting the transmission the station needs to know whether there is activity
at the receiver
CSMA only shows whether there is activity at the sender
In a radio system, multiple transmissions can occur successfully if the destinations
are out of range

MAC IEEE 802:

Frame composition(data field, addresses field, error control field)


Frame decomposition (address decoding, error detection)
MAC (nonexistent for traditional L2 protocols)
One LLC can work with multiple MAC sublayers

Lan topologies:

Tree & Bus (three with one branch)


o Multipoint link
o Every sent frame is received by all other stations. Each station has a unique
address
o All stations are directly connected to the network via a hardware interface tap
using full duplex model
o Flow control is needed for collision avoidance. Data I sent in small frames.
o Terminator is used at the end in order to absorb the frames
Ring
o Closed one way circle of repeaters connected with point to point links. Receive
data from one station, forward it to the next. The stations are attached on the
repeaters.
o Data is sent using frames. The frame passes all stations. The destination
recognizes itself and copies the frame. The frame circules to the souce and is
removed.
o The MAC controls when the station can send a frame.
Star
o Each station is directly connected to a common central node.
o The central node can broadcast (Physical star,logical bus).Only one device can
send data at the same time.
o The central node is called a hub.

Chapter 5: Ethernet
-Medium fat coaxial cable with up to 2,5 km in length using repeaters on each 500m
-Up to 256 stations can be connected
-Multidrop cable (2.94 Mb/s)
Cabling 2 pairs of wires are always used:

Cabling types: Linear, Backbone, Three, Segmented. Manchester encoding is used to be able to find the
start, end and middle of each bit with no ambiguity while not using any external clock.
Ethernet frame the sending adapter encapsulates an IP datagram inside the Ethernet frame.

Preamble: 8 bytes. Synchronizes the sender and receiver, used for clock speed.
CRC: 4 bytes. For error detection at the receiver, who drops the frame if error is detected.
Type: 2 bytes. Determines the upper layer protocol, most frequently IP.

Addressing alternatives:

Broadcast medium all nodes receive all frames. Addressing determines what frames to keep
and what to drop. Frames can be sent as: Unicast(single destination), Multicast(group) and
Broadcast(all).
Dynamic addressing Random addressing selection, Broadcast does anyone uses address XX?,
If yes repead the selection
Static addressing (ex. Ethernet)

Switched Ethernet:
Hub: The hub will flood all ports except the one that sent the frame. The hub doesnt
understand the layer2 addresses (MAC), thus is very fast.
Switch: Is the same as a learning bridge. Every Switch has a source table in his RAM memory
where all source MAC port pairs are kept after he learns them. When a Switch receives an
Ethernet frame, he searches his address table for the destination MAC. If match is found, he
sends the frame to the designated port only (timer is reset and address I kept mostly 5 min). If
no match is found, he uses flooding. Unlike the hub, it buffers the frames that are sent to the
same port simultaneously and doesnt allow collisions.

Exercise 1: Computer networks


1. Anything that is represented in bits is called information.
2. Computers can manipulate info. Networks create access to info.
3. Direct or indirect access to every other node in the network is called connectivity.
Direct: point to point, multiple access, bus, full mesh
Indirect: switched networks(switches), inter-networks(routers), star, ring, tree
4. Multiplexing = separation.

5. ISO OSI Model: Lower three layers are peer-to-peer. Next four layers are end-to-end.
6. Each layer takes data from above. Adds header and tail and passes new data unit below.

Exercise 3: The Data Link Layer


1. Data transfer with various protocols through various links.
2. Each protocol provides services.
3. Framing (data encapsulation into frames), Access to the channels(MAC addresses),
Reliable communication between the neighboring nodes, Flow control, Error detection
and correction. Half-duplex(one-way communication only one of the connected nodes
can send in a given moment), Full-duplex(two-way communication the both nodes can
send at the same time)

Exercise 4: The Data Link Layer


1. Routers Connect two or more different networks. Third level devices.
2. Switches Connect two or more devices in the same network. Types: switch, bridge,
repeater.
3. LAN technologies and LAN systems
48 bit MAC addresses: forward a frame from one interface to another physically
connected interface. It is written in NIC ROM, sometimes it can be alternatet
using software.
Types: Unicast, Multicast, Broadcast.
Source MAC address: Mac address of the sender. Switches learn using source
MAC addresses. Records the port where the frame arrived and maps it to the
source MAC address.
Destination MAC address: MAC address of the receiver. Switches forward based
on destination MAC addresses. If the switch knows at which port is the
destination MAC address, it forwards the frame to that port. Otherwise, the
switch forwards the frame to all the ports except to the port where the frame
has arrived.

Exercise 5: LAN technologies and STP


1. Bridge is a Layer 2 device used for sharing or segmenting a network. The bridge has
ability for storing and selective forwarding of the data frames between two network
segments. The bridge achieve this by learning the MAC address of all devices connected
in each segment. This information is later used for constructing the MAC table for
blocking or forwarding traffic. This results in less collision domains and greater
efficiency. Bridges dont block broadcast traffic. Bridges are switches with two
forwarding ports.

Potrebbero piacerti anche