Note
Note
Outline Syllabus
1. Introduction
• Networks eg: LAN WAN
• Physical Medium
• Modulation and Encoding
2. Data Link Layer
• Node to node communication
• MAC Address
3. Medium Access Control Sublayer
4. network layer
5. Transport Layer
• End to end communication
6. Application Layer
• network protocols
7. Network Security
• security
1
Why Layers?
• Possible to have without layers
• These layers are for the sake of ease
• So people can work in different layers
2
Lecture 1
Outlines
• Uses of Computer Networks
– Applications and Issues
• Network Hardware and Software
Next Lecture
• OSI Reference Model
• Exmaples of practical networks
Uses of ComputerNetworks
Business Applications
• Main goal is for effective resource sharing this may include proper sharing
of inforamtion too
• A network with two clients and one server
Ex: Shared Printers Ex: Virtual Private Networks
• The used model is theclient server model
3
• The medium of access to the server would be either guided or non-guided
• If we look at theclient-server model in detail, we see that two processes
are involved,
– one on the clientmachine
– and one on the server machine.
• Communication takes the form of the client process sending a message
over the network to the server process.
• The client process then waits for a reply message.When the server process
gets the request,it performs the requested work or looks up the requested
data and sends back a reply.
GOALS
1. Resourceand information sharing
2. Powerful communication medium (ex:e-mail,video-conferencing)
3. Doing businesses electronically with other companies
4. Doing businesses with consumers over internet
Home Applications
• for many web-based servers are based on client server model
• but some services like torrent use peer-peer models
1. Peer-Peer Communciation
4
• In a peer-peer system there are no fixed clients and servers
• Services are requested from an available peer in thr system otherwise
neighboring peers are directed to a peer having the requested resource
• A practical application would be torrent services
2. E-Commerce Tags
Mobile Applications
Mobile Applications
• Taxi services
• Useful where no reliable local networks are available
• Where mobility is essential
5
network can be established anywhere
Copyright issues
Security issues - viruses,phishing,spoofing
Privacy issues
Profiling users
• Main selling points of big giant companies
• Advertisements are profilied to users
• This is becoming a social issue
Network Hardware
6
all the others
– An address field within the packet specfies the intended recipient.
– Upon receiving a packet, a machinechecks the address field.
– If the packet is intended for the reciving machine, that machine
processes the packet,if the packet is intended for some other
machine,it is ignored
2. Point-to-point links
– Have many connections between individual pairs of machines
• Classification of networks on their scale is discussed below:
7
• Can be divided into two depending on the channel is allocated
(a) Static allocation
– A typical example would be to divide time into discrete
intervals and use a round-robin algorithm
– Each machine will be able to broadcast only when its time
slot appears
– This would be a waste of resources
(b) Dynamic allocation
– Either centralized or decenteralized
i. Centralized method
∗ There is a single entity(ex:a bus arbitration unit)
∗ This determines who goes next
ii. Decenteralized method
∗ There is no central entity
∗ Each machine must decide for itself whether to transmit
8
Wide Area Networks
The internet
• Collection of inter-connected networks
• A network is composed of subnets
9
Lecture 2 Continued
Network Software
Protocol hierarchies
• Basically to reduce design complexity
10
1. Layered Architecture
• To reduce design complexity :most networks areorganized as a stack
of layers
• Each layer provides a serivce to thehigher layerwhile not letting other
layers knowhow they perform this serivce
• Each layer is kind of like a virtual machine and can be up-
graded/changed without affecting others
Similar to whats happening in computer science: OOP Hid-
ing, data abstract, data encapsulation, OOP
Now if a layer n machine communicates with layer n of
another machine.. They need to agree on the protocol
(a) Layering Advantages
• Reduce complexity -breaks a complex task into smaller easier
forms(i.e. stack of layers or levels)
• The no. of layers, the name of each laye, the contents of each
layer, and the function of each layermay differ from network to
network
• Lower layers can provide services to higher layers while hiding
information on how they actually carry out their services
• Flexible and easliy upgradable
• Allows parallel execution due to logical seperation
(b) Layers and interfaces
• Each layer should perform specific collection of well-understood
functions
• Between each pair of adjacent layers is an interface
– The interfaces defines which primitve operations and serives
the lower layer makes available to the upper layer
– There should be a clean interface between the layers so that it
minmizes the amount of inforamtion transfer between layers
– Should be able to easliy change the technology, implimenta-
tion, or the protocol of a single layer without affecting the
layers above or below that. (Ex: switching from telephone
lines to satelite or wireless)
So we have already learnet why layering is important and
the advantages of layering.
Here this slide highlight some of the key points in layering.
The first point states that each layer should perform a well
defined function. So if we go back to our airport example,
different layers carried out well defined tasks. For example,
11
the boarding pass was always issued by the check in counter,
the passport was stamped by the immigration.
Now the second point states that there should be a clean
interface and communication must be minimized. so, in our
airport example, the immigration is not going communicate
back and forth between check in counters.
another important advantage of layering is that we can easiliy
upgrade one layer woithout affecting others. a simple example
os given here.
(c) Protocols and physical medium
• A protocol defines the set of rules and regulations that are to be
followed by two parties when making a connections and executing
some task(i.e.communicate)
• A protocol specifies the sequence, the format, and layout of the
messages that is exchanged between two or more systems to
accomplish a given task
• When layer n of one machine(i.e host 1)communicate with layer
n of another machine(host 2), the rules and conventions used in
this communication is collectively known as layer n protocol
• Physcial medium performs the actual transmission of data
between two hosts.
Note: data does not directly transfer from layer n of host 1
to layer n of host 2 directly
[[./images/proh3.png ]]
(d) Network architecture and protocol stack
• A set of layers and underlying protocols are defined as a network
architecture
• A list of protocols used by a system,one protocol perlayer, is
called a protocol stack
• The network architecture should provide sufficient information
to an implmentator to build the hardware or write a program for
each layer so that it will obey the protocol
• Details of the interfaces are hidden away inside the machine and
not visible from outside
What is a network architecture:
What is a protocol stack:
Important: the network architecture provides the relevant
information for person to build devices targetting different
layers.
12
For example, a router may work with three sepearte layers
only.
The only requirement is the person needs to know what
protocols the device needs to comply with.
For example when you buy a router you make sure that it
works with Wifi 802.11/b/g/n and support RJ 45 ethernet
protocol.
13
• Error detection and error correction are performed by adding redun-
dant bits to the message both higher and lower layers to ensure that
packets are recived and right data is recived
2. How to find the correct path among many posibilties?
• Routing algorithm are used to find the appropriate paths for each
packet
• Each packet will take different paths
3. How will the network evolve? Or how to connect existing networks to new?
• For this protocol layering might help. So that you can replace/upgrade
one layer without totally overhauling the other layers
4. How to identify each computer in a large network?
• Naming and addressing using IPV4 and IPV6
There are several design issues
(a) What if the information is not properly received: error
detection and error correction by adding redundant bits to
the message .. applied at both higher and lower layers to
ensure that packets are received and right data is received.
(b) Finding the correct path among many possibilities: Routing,
each pcket will take difefernt paths
(c) Evolution: How to connect existing networks to new.. For
this protocol layering might help.. So that you can replace
one layer without totally overhauling the second
(d) How to identify each computer in a large network: naming
and addressing IPV4 and IPV6
5. What is the maximum message size?
• Different technologies and transmission media have different limita-
tions.Thus, we need to disassemble and re-assemble when two or more
technologies are used for transferring data
6. How to perform resource allocations and management?
• Statistical multiplexing,flow control, congestions, oversubscription
7. What is Quality of Service(QoS)?
• Different services have different requirements
8. How to preserve security,authentication and confidentiality when data
travel via different ISPs and routers?
• Different encryption methods can be used
14
(a) Maximum message size: different tech different limitations.
Then we need to disassemble and re-assamble (Aggregation
methods)
(b) Resource allocations and managelemt: Staistical multiplex-
ing, flow control, over subscription (TDM, scheduling)
(c) Quality of service: different services have diffefent require-
ments ( maximum delay, jitter, noise)
(d) Security: authentication and confidentiality.. The data
travel via different ISPs and routers so security have to be
ensured.
15
Service primitives
• A service is formally specified by a set of primitives(operations)that a layer
provides to the layer above it
• A service defines whatoperations the layer is prepared to perform,but it
does not reveal how they perform these operations
• A service relates to an interface between two layers, where the lower layer
being the service provider and the upper layer being the service user
• If the protocol stack is loacted in the operating system, as it often is, the
primitives are normally system calls
• The primitives forconnection-oriented service are different from those of
connectionless service
• A protocol in contrast is a set of rules governing the format and meaning
of packets sent between peer entities on different machines
Now let’s try and understand service primitives.
These are used to communicate via the interface between two seperate
layers.
A service is formally specified by a set of primitives (operations) that
a layer provides to the layer above it.
A service defines what operations the layer is prepared to perform,
but it does not reveal how they peform these operations.
A service relates to an interface between two layers, where the lower
layer being the service provider and the upper layer being the service
user.
16
If the protocol stack is located in the operating system, as it often is,
the primitives are normally system calls.
The primitives for connection-oriented service are different from those
of connectionless service.
A protocol in contrast is a set of rules governing the format and
meaning of packets sent between peer entities on different machines.
1. Additional references Additonal references
• This discusses four different kinds of service primitives
(a) Request: A primitive sent by layer (N + 1 ) to layer N to request a
service. It invokes the service and passes any required parameters.
(b) Indication: A primitive returned to layer (N + l) from layer N to
advise of activation of a requested service or of an action initiated by
the layer N service.
(c) Response: A primitive provided by layer (N + 1) in reply to an
indication primitive. It may acknowledge or complete an action
previously invoked by an indication primitive.
(d) Confirm: A primitive returned to the requesting (N + l)st layer by the
Nth layer to acknowledge or complete an action previously invoked
by a request primitive.
2. Service Primitives(1)
Here you see six primitivess that are often used un connection-
oriented services.
Remeber, these take place within the machine/host.
You can use these primitives for a simple client-server communi-
cation,
Primitive Meaning
3. Service Primitives(2)
Here you get to see a simple client server interaction.
17
There are two machines. One is a client, the other is the server
The protocol stack, well not the entire stack, but a portion of it
is situated within the operating system.
So the service calls, primitives, are basically system calls within
each machine.
First, the server executes LISTEN to indicate that it is prepared
to accept incoming connections. You basically block the server
process until a request for connection appears.
Next, the client process executes CONNECT to establish a
connection with the server. Typically you need to specify the
address you need to connect to:
Now the operating system will send a packet to the peer asking
it to connect, as shown by (1) in Fig. 1-18.
The client process is suspended until there is a response.
When the packet arrives at the server, the operating system sees
that the packet is requesting a connection. It checks to see if
there is a listener, and if so it unblocks the listener.
The server process can then establish the connection with the
ACCEPT call.
This sends a response (2) back to the client process to accept
the connection. The arrival of this response then releases the
client.
At this point the client and server are both running and they
have a connection established.
4. Service Primitives(3)
18
Here you see something very important, now in the first table
you see how primitives actually relate to communication between
the two machines.
LISTEN takes place within the server machine and it does not
relay any information/pass any packets to the client.
On the other hand, CONNECT takes place in the client will
initiate a packet transfer.
19
Reference Models(Protocol Stack)
Design Considerations
• some layers can be combined together as required
1. A layer should be created where a differentabstraction is needed
2. Each layer should perform a well defined function
3. The function of each layer should be chosen with an eye toward defining
internationally standardized protocols
4. The layer boundaries should be chosen to minimize the information flow
across the interfaces
5. The number of layers should be large enough that distinct functions need
not be thrown together in the same layer out of necessity and smallenough
that the architecture does not become unwieldy
20
• Note that the recommended textbook uses bottom-up approach
TCP/IP Model
• Transmission Control Protocol/Internet Protocol ~ has 4/5 layers
• Transmission Control Protocol/Internet Protocol suite of protocols has
become the dominant standard for internet working
• TCP/IP represents a set of public standards that specify how packets of
information are exchanged between computer over one or more networks
• This module specifically only discusses about TCP/IP
• TCP model has two forms
1. 4-layer model
– Data link layer
– Internet layer
– Transport layer
– Application layer
2. 5-layer model
– Physical layer
– Data Link layer
– Network layer
– Transport layer
– Application layer
1. Layer 1 Physical Layer
21
• Provides the physical connection between two devices/networks com-
munciation
• We have two applications that generate data(bits) and underlying
network converts this into analog signals and transport across the
medium
• Can be wired or wireless medium
2. Layer 2 Data Link Layer
• Initially we had just two devices communicating with each other
• What if more than two devices want to communicate???
22
• Now the solution would be to create multiple networks
• When these networks want to communicate with one another, we
need to connect them via LEVEL 3 switches and routers
• To connect them we need a physical path as well as routing(This is a
way of instructions for swirching)
4. Layer 4 Transport Layer
So now you have multiple networks,
And these networks may run different applications. For example
some may use web browsers, some emails, video streaming, voip
These applications can be vaguely categorized under different
processes.
For example, voip and video file down laoding may require a
direct link (connectio oriented), whereas, video streaming may
not require direct link.
So we perform these using transport layer protocols.
So in the class room exmple, if the two teachers are singining a
duet (synchronization is important) not only that you have to
create a physical conenction between the classes, you also have
ensure that they are synchronized, managed, and pay attention
to each other.
Transport layer provides errior free transmission and provides
traffic management features.
23
5. Layer 5 Application Layer
So finally, we have the application layer.
The application can be the browser, email, . . . .etc..
application to application communication is peformed using the
application layer.
If im sending an email, i open the browser and go to my email
client.
the receiving person would also do the same.
6. Network devices and layers
24
Model used for this text
• TCP/IP
25
• The following image shows a more detailed version
26
Critique of OSI model and protocols
1. Bad Timing - This implies that this model was introduced way before
modern protocols are introduced
2. Bad Technology
3. Bad implementations
4. Bad politics
Example Networks
Tutorial 1
1. Explain how the notion of layering and internetworking make the rapid
growth ofapplications such as the World Wide Web possible.
2. What are two reasons for using layered protocols? What is one possible
disadvantageof using layered protocols?
3. Which OSI layer is responsible for the following networking functions?
a. Determining the best path to route packets. b. Providing end-to-end
communications with reliable service c. Providing node-to-node communi-
cations with reliable service within a network
4.
27
– Thus, passband modulation will ensure that the signal match the
channel frequency
Line Coding-Introduction
• Defined as the process of converting binary data to a *a digital sig-
nal*(map binary bits to voltage or current levels)
28
Signal level and Data level
• Signal level - The number of possible values allowed in a particular
signal(ex:voltage levels, amplitude levels)
• Data level - The number of values used to represent data(ex:binary 0s
and 1s, so 2 levels)
29
Siganl rate and bitrate(Baud rate,Symbolrate,modulation rate,pulse
rate)
1. Signal Rate
• Signal rate, baud rate, pulse rate,modulation rate, and symbol rate
are related one to another
• The signal rate is defined as the number of signal elements sent in
one second
• These signal elements may go through voltage,phase, or frequency
changes(i.e,transitions)over time
• A signal element is also called a symbol or a pulse
• A symbol is the smallest possible thing in a system, which can encode
information
• The baud rate is defined as the rate of change of symbol(i.e. symbol
rate,signaling rate,pulse rate)
2. Signal Rate vs Bit rate
• Bit rate can be defined as the number of bits transmitted per second
• Each bit can be carried by an "X" number of symbols
• In other words,each symbol may correspond to more or less than one
bit
(e.g. in NRZ and Manchester coding, each bit is carried by one symbol
and two symbols, respectively)
• If X=1,each bit is carried by a single symbol: bit rate = signal rate(i.e.
symbol/baud/pulse rate)
• If x>1,i.e. each bit is carried by more than one symbol: bit rate <
signal rate
• If x<1, i.e. each bit is carried by more than one symbol: bit rate >
signal rate
Formulae for bit rate
30
•
Bitrate = P ulseRate × m
EXAMPLE 01
Q. A signal has two data levels with a pulse duration of 1 ms. We calculate
the pulse rate and bit rate as follows:
•
1
P ulseRate = = 1000pulses/s
10−3
•
EXAMPLE 02
Q. A signal has four data levels with a pulse duration of 1 ms.We calculate
the pulse rate and bit rate as follows:
•
1
P ulseRate = = 1000pulses/s
10−3
•
Bandwidth
• A digital signal has an infinite bandwidth(Fourier analysis can be used to
decompose a digital signal)
• A periodic digital signal can be decomposed into infinte bandwidth and
discrete frequnecies
31
• A non-periodic digital signal can be decompsed into infinite bandwidth
and continous frequnecies
• The following images show the time and frequency domains of a periodic
and non-periodic digital signals
1. Bandwidth Efficiency
• With NRZ, the signal may cycle between the positive and negative
levels up to every 2 bits(in the case of alternating 1s and 0s)
32
• This means that we need a bandwidth of at least B/2 Hz when the
bit rate is B bits per second
• This relation comes from the Nyquist rate. It is a fundamental limit,so
we cannot run NRZ faster wthout using more bandwidth
DC Components
• When voltage level remains constant for a while, very low frequencies are
often created
• These frequencies around zero are called DC or Direct Current Com-
ponents
• Over one cycle period,if all positive voltages are cancelled by negative
voltages then DC component is zero(0)
• In line coding, a signal with DC components is treated as a distorted signal
and it can create errors in received signal due to following reasons:
– They cannot pass through a communication media such as a telephone
lines, which only allows frequencies above 200 Hz.
33
EXAMPLE 03
Q. In a digital transmission, the receiver clock is 0.1 percent faster than the
sender clock.How many extra bits per second does the receiver receive if the
data rate is 1 Kbps? How many if the data rate is 1 Mbps?
At 1 Kbps:
1000 bits sent -> 1001 bits received -> 1 extra bps At 1 Mbps:
1,000,000 bits sent -> 1,001,000 bits received -> 1000 extra bps
34
1. Unipolar
• Uses only one polarity (but two signal levels)
• The polarity is assigned to one of the two binary states, usually the 1
• Very simple and primitive(almost obsolete)
• Send voltages pulses along wired links
Bits Levels
1 +V
0 0V
Drawbacks
• Since the average amplitude is not zero,unipolar will produce a DC
component
35
• Synchronization issues:
– A long series of 1s or 0s may result in synchronization problems
since there is no change in the signal
– Solution would be to use a seperate parallel line to carry clock
2. Polar
• Use two voltage/amplitude levels(ex: +5V and -5V)
• Helps to dilute "DC component" problem
• Used in 4 main types of coding
Bits Levels
1 +5V
0 -5V
i. NRZ-invert (NRZ-I)
• Alternate the voltage level for binary 1s and no voltage change
for binary 0
• Advantage : 1s in data streams enable synchronization
• Drawback : long sequence of 0s still causes synchronization
issues
36
• NRZ-I provide better synchronization than NRZ-L
• However,neither provide full self-synchronizatiom
• To ensure complete synchronization, there must be a
signal change for each bit
(b) Polar RZ
• Uses two distinct voltage levels to represent binary 1s and 0s(ex:
1=+5V, 0=-5V)
• The signal returns to no-voltage(0 V) halfway through the bit
interval
• Advantge: Good synchronization
• Drawback: Consume more badnwidth as 2 signal changes
i.e, (2 signal elements) are required to encode 1 bit
37
• Similar to Manchester, with the following exceptions
– bit 0 represented by a transition at the beginning of bit
interval
– bit 1 represented by no transition at the beginning of bit
interval
– 2 signal changes for 0s and 1 signal change for 1s
• Used by IEEE 802.5 (Token Ring)
3. Bipolar
• Use three signal levels
• Typically, we use two non-zero and one zero voltage levels(i.e +V,-
V,0V)
• Assign bit 0 =0V and bit 1=alternates between +V and -V
Bits Levels
1 +V,-V
0 0V
Ex: In sequence of bits, the 1st occurance of "bit 1" is assigned a +V,the
2nd occurance of bit 1 will be assigned -V, and the 3rd will be assigned a
+V again
• Advantage: Consume less bandwidth required than with Manchester
coding(for any sequence of bits)
• Disadvantage: Loss of synchronization may take place when the bit
sequence has a series of consecutive 0s
• AMI,B8ZS, and HDB3 encoding techniques utilize Bipolar pulse
shaping
• Reference 1
• Reference 2
4. Multilevl Codes
38
• In multilevel coding, more than three signal levels and two data levels
are used
– 2 data elements(bits) are encoded by one signal element
– Produce a higher data rate (2 times faster than NRZ-L)
– Receiver has to process 4 signal levels
5. Block Codes
• Unlike line codes which operate on a stream of information bits, block
codes operate on block of information bits
• Redundant bit(s) are added to each block of information bits to ensure
synchronization and error detection
:smile: :cry: :heart: :bat:
39