Network
Network
Amith Bandara
Department of Information Systems
2
Transmission Media
• The transmission medium is the physical path between transmitter
and receiver in a data transmission system.
3 4
Transmission Medium can be Twisted-Pair Cable
• Simplex • Consists of eight individually insulated wires that
• Transmission in one direction only. are twisted together in pairs.
• Ex: Fiber optic cable • Sometimes a metallic shield is placed around them,
• Half-duplex called as Shielded Twisted-Pair (STP).
• Transmission in both directions; but not at the same time. • Cable without outer shielding is called Unshielded
• Full-duplex (duplex) Twisted-Pair (UTP).
• Simultaneous transmission in both directions. • Used to connect telephone subscribers to switching
centers and for wiring local area networks.
5 6
7 8
Coaxial Cables Fiber Optic Cable
• Requires Male and Female BNC (Bayonet Neill– Concelman) • Optical fiber is a thin (2-125 mm), flexible medium capable of
connectors. conducting an optical ray.
• Fiber is built of various glasses or plastics.
• Very high bandwidth (currently up to 10 Gbps).
• Used for long-distance trunks, local area networks, high- speed
transmissions.
• Inherently unidirectional.
• Light wave use as a signal
• Half duplex
9 10
11 12
2. Single Mode Fiber: Signals
• By reducing the radius of the fiber core to the order of the wavelength, only
the axial ray can pass. • A signal can be viewed as a function of time (time domain) and as a
• Single Mode fiber has superior performance but needs a laser diode as a light function of its frequencies (frequency-domain)
source (instead of a LED for multimode fiber).
• Signals:
• Continuous (analog)
• Discrete (digital)
13 14
17 18
• Encoder / Decoder
Data Encoding • Digital data Digital Digital data
Analog data Signal Analog data
• Technique that used to map data into signal
• All of the following combinations are used: • Modulator / Demodulator
• Digital data Analog Digital data
Analog data Signal Analog data
19 20
Analog vs. Digital Data/Signaling Digital Data / Digital Signals
• Recall:
• A digital signal is a discrete voltage pulse.
• Each pulse represents one or several bits.
• Terminology
• Bit Length: Time to transmit a bit. Different between
communication channel
• Data Rate: Rate at which data can be transmitted (measured in
bps) (Capacity)
• Modulation Rate: Rate at which the signal is changed (measured in
signal elements per second or baud). Time to combine
data with signal or derive data from signal
21 22
Cont Cont
• A large number of digital data/digital signal encoding techniques are
available.
• The criteria for selecting a scheme are;
• Frequency Spectrum
• Bit Timing (Clocking)
• Error Detection
• Immunity to interference
23 24
• Unipolar Encoding. • Polar Encoding.
• Two issues
• DC component
• Lack of synchronization
25 26
27 28
• Polar Encoding - Encoding Schemes • Bipolar Encoding - Encoding Schemes
• Manchester • Alternative Mark Inversion (AMI)
• 0 = transition from positive to negative in middle of interval • 0 = Zero level
• 1 = transition from negative to positive in middle of interval • 1 = Positive and negative alternatively
• Differential Manchester: Always a transition in middle of interval
• 0 = transition at beginning of interval
• 1 = no transition at beginning of interval
29 30
31 32
Analog Data/ Digital Signal Pulse Code Modulation (PCM)
• Sampling Theorem (by Nyquist);
• Transmission is accomplished in two steps; If a signal f(t) is sampled at regular intervals of time and at a rate higher than
• Conversion of analog data into digital data (Digitization) twice the highest significant signal frequency, then the samples contain all the
• Digital data is converted into a digital signal information of the original signal. The function f(t) may be reconstructed from
• Pulse code modulation is used to convert analog data into digital data these samples by the use of a low pass filter.
• Then use NRZ-L method to convert digital data into digital signal
33 34
35 36
• Frequency Modulation (FM)
Multiplexing at the Physical Layer
• Goal: Get many information flows on a single physical channel.
• Basic techniques:
• For Analog:
• Frequency Division Multiplexing (FDM)
• Wave Division Multiplexing (WDM)
• For Digital:
• Time Division Multiplexing (TDM)
37 38
39 40
Wave Division Multiplexing (WDM) Time Division Multiplexing (TDM)
• Used for digital telephone transmission, satellite communication.
• Idea: Multiple signals can be carried on a single transmission medium
by interleaving portions of each signal in time.
41 42
Thank You
43 44
Data Link Layer
Fundamentals of Computer Networks • Provides for reliable transfer of information across physical link
• Includes:
ITM 3213 • Transmission of blocks of data (The PDU at the Data Link Layer (DLPDU) is
typically called a Frame. A Frame has a header, a data field, and a trailer )
• Synchronization
• Error control
Data Link Layer • Flow control
Amith Bandara
Department of Information Systems
2
5 6
7 8
Error Correction Stop-and-Wait ARQ
• Two types of errors • One frame received and handled at a time
• Lost frame • If frame is damaged, receiver discards it and sends no
• Damaged frame acknowledgment
• Automatic Repeat reQuest (ARQ) • Sender uses timer to determine whether or not to retransmit
• Error detection • Sender must keep a copy of transmitted frame until acknowledgment is
• Positive acknowledgment received
• Retransmission after time-out • If acknowledgment is damaged, sender will know it because of
• Negative acknowledgment and retransmission numbering
9 10
11 12
Flow Control Stop & Wait Flow Control
• Sender sends a frame
• Technique for controlling data rate so that sender does not over-run • Receiver receives frame & acknowledges it
receiver • Sender waits to receive “ack” before sending next frame (If receiver is
• Two approaches exist: not ready to receive another frame it holds back the ack)
• Stop-and-wait • One frame at a time is sent over the transmission line
• Sliding-window
13 14
Utilization (Efficiency) of Stop & Wait Utilization (Efficiency) of Stop & Wait
• Transmission time: time taken to emit all bits of frame at sender = Tt
= L / B.
• Propagation time: time taken for signal to travel from S to R. Thus first
bit transmitted at t=0 arrives at R at t = T p = d / V.
15 16
Utilization (Efficiency) = U Utilization (Efficiency) of Stop & Wait
U = Active time of sender / Total time of one cycle
• With stop & wait scheme, for high channel utilization, we need a low
a (since U= 1/(1+2a))
Utilization (Efficiency) of Stop & Wait Utilization (Efficiency) of Stop & Wait
• WAN using ATM • LAN
• d = 10 km,
• B = 10 Mbps,
• V = 2 x 108 m/sec
• L = 1000 bits à a = 0.005 ~ 0.5 à U = 0.5 ~ 0.99
19 20
• Suppose that the stop and wait protocol is used on a link with a bit
rate of 64 b/s and 20 second of propergation delay. Assume that the
Sliding-Window Flow Control
transmission delay for the acknoledgement and the processing time
at nodes are negligible. Then the minimum frame size in bytes to • Pipeline transmission of successive frames
achieve a link utilization of at least 50% is ? • Transmit up to “N” frames if necessary without receiving acks.
• Wait for acks when “N” unacked frames in transit
• For full duplex transmission each station needs a sending window &
receiving window.
21 22
23 24
Error Detection Error Detection
• Basic Principle • Two common techniques
• Transmitter: For a given bit stream M, additional bits (called error-detecting • Parity checks
code) are calculated as a function of M and appended to the end of M • Cyclic redundancy checks (CRC)
• Receiver: For each incoming frame, performs the same calculation and
compares the two results. A detected error occurs if there is a mismatch
• Parity Check
• One extra “parity” bit is added to each word
• Odd parity: bit added so as to make # of 1’s odd
• Even parity: makes total # of 1’s even
• Single parity is very effective with white noise (noise on a line without any
active signals on it; e.g., Thermal Noise), but not very robust with noise bursts
(which may extend over whole word duration).
25 26
27 28
Cyclic Redundancy Checks Cyclic Redundancy Checks Examples
• Method • M = 110011, P = 11001, R = 4 bits
• Extend M with n ‘0’s to the right (= M)(shift left by n bits
2n • 1. Append 4 zeros to M, we get 1100110000
• Divide extended message by P to get R (2n M / P = Q + R/P)
• Add R to extended message to form T (T = 2n M + R) • For each stage of division, if the
number of dividend bits equals
• Transmit T number of divisor P bits, then
• At receiver, divide T by P. Nonzero remainder means: à error Q=1, otherwise Q=0
29 30
31 32
Can Detect Error control techniques
• All single-bit errors • Forward error control:
• All double-bit errors, as long as P(X) has a factor with at least three • Error recovery by correction at the receiver [Forward Error Correction (FEC)]
terms (as long as p has at least three 1s) • Backward error control:
• Any odd number of errors, as long as P(X) contains a factor (X+1) • Error recovery by retransmission [Automatic Repeat Request (ARQ)]
• Any burst error for which the length of the burst is less than the
length of the FCS
• Most larger burst errors
33 34
35 36
Stop & Wait ARQ
• Frame/ACK could be lost à Uses a timeout mechanism
• Possibility of duplication à Number frames
• Only need a 1-bit frame number alternating 1 and 0 since they are
sent one at a time
37 38
Go-back-N ARQ
• If the receiver detects an error on a frame, it sends a NAK for that
frame.
• The receiver will discard all future frames until the frame in error is
correctly received.
• Thus the sender, when it receives a NAK or timeout, must retransmit
the frame in error plus all succeeding frames.
• Sender must maintain a copy of each unacknowledged frame.
39 40
41 42
43 44
Three types of stations Two link configurations
• Primary station - (e.g., Mainframe) Controls the operation of the link, • Unbalanced configuration - One primary and one or more secondary
issues commands, and receives responses stations
• Secondary station - (e.g., Terminal) Usually only communicates • Balanced configurations - Two combined stations
(responds) to a primary station
• Combined station - Can be both a primary and a secondary
45 46
47 48
HDLC Frame Structure HDLC Frame Structure
Flag fields
• Flag fields
• 8 bits (01111110)
• “Bit stuffing” is used for data transparency
• Bit stuffing: whenever five 1’s are transmitted, extra zero is inserted
49 50
51 52
Introduction
Fundamentals of Computer Networks • Main Task of the network layer is to move packets from the source
host to the destination host.
• Lowest layer to deal with end-to-end issues!
ITM 3213
Network Layer
Amith Bandara
Department of Information Systems
2
3 4
• Traffic Control:
• Naming and Addressing:
Control the packets of being subjected to a traffic (Prevent the network from
• How to find the name of a network node?
becoming bottleneck
• Congestion control. • Internetworking:
• Control the congestion of packets. • How to interconnect heterogeneous networks?
• Rate control.
• In transmission the packets should be send in a better way with in a minimum time
period.
• Rate control means packets should transfer in a best way with in a minimum transmit
time (does not mean send in a higher speed)
5 6
7 8
Datagram Packet-Switching Virtual-Circuit Packet Switching
• Each packet is routed independently. • All packets of a VC follow the same route.
9 10
11 12
Summary Packet Routing
• The following implementations are feasible: • There are two parts to the routing problem:
• How to pass a packet from an input interface to the output interface of a
router (packet forwarding)?
Connectionless service Connection-oriented service • How to calculate routes?
• Packet forwarding is done differently in datagram and virtual-circuit
packet networks.
• Route calculation is done in a similar fashion.
Unreliable Speed Reliable Low Speed
13 14
15 16
Packet Forwarding with Virtual Circuits Packet Forwarding of Virtual Circuits
• Recall: In VC networks, the route is setup in the connection • When a packet with VCin in header arrives from router n in, ...
establishment phase. • The router looks up the routing table for an entry with (VCin, nin).
• During the setup, each router assigns a VC number (VC#) to the • The routing table lookup yields (VCout, nout).
virtual circuit. • The router updates the VC# of the header to VCout and transmits the packet to
nout
• The VC# can be different for each hop.
• Good: Routing table is small (how small?).
• VC# is written into the packet headers.
• Bad: Changing the route is complicated Routing table changes for
each virtual circuit.
17 18
Comparison IP Address
• An IP address is a unique address that identifies a device on the internet or
a local network
• IP stands for "Internet Protocol," which is the set of rules governing the
format of data sent via the internet or local network.
• IP addresses are the identifier that allows information to be sent between
devices on a network
• An IP address is a string of numbers separated by periods. IP addresses are
expressed as a set of four numbers — an example address might be
192.158.1.38
• Each number in the set can range from 0 to 255. So, the full IP addressing
range goes from 0.0.0.0 to 255.255.255.255
19 20
IPv4 & IPv6
• IPv4 is actually the first version of IP to be used. It was launched all
the way back in 1983 and, even today, it’s still the most well-known
version to identify devices on a network
• The IPv6 is a newer version of IP that uses a 128-bit address format
and includes both numbers and letters
• The main difference between IPv4 and IPv6 is the address size of IP
addresses.
• The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal
address.
21 22
23 24
IP Address Classes Class A Network
• IP address divide into five separate classes based on four address bits • This IP address class is used when there are a large number of hosts.
• Classes A, B, C offers addresses for networks of three distinct network • In a Class A type of network, the first 8 bits (also called the first octet)
sizes. Class D is only used for multicast, and class E reserved identify the network, and the remaining have 24 bits for the host into
exclusively for experimental purposes. that network.
• An example of a Class A address is 102.168.212.226. Here, “102”
helps you identify the network and 168.212.226 identify the host.
• Class A addresses 127.0.0.0 to 127.255.255.255 cannot be used.
25 26
27 28
Network Host
• Class A à 1 -126 (Bit stream start from 0) • Class A à 224 - 2 = 16777214
• Class B à 128 – 191 (Bit stream start from 10) • Class B à 216 - 2 = 65534
• Class C à 192 – 223 (Bit stream start from 110) • Class C à 28 - 2 = 254
• Class D à Bit stream start from 1110
• Class E à Bit stream start from 1111
29 30
31 32
Subneting Subnet mask
• A subnet, or subnetwork, is a segmented piece of a larger network • A subnet mask is like an IP address, but for only internal usage within
• Organizations will use a subnet to subdivide large networks into a network
smaller, more efficient subnetworks. • Routers use subnet masks to route data packets to the right place.
• One goal of a subnet is to split a large network into a grouping of • The subnet mask splits the IP address into the host and network
smaller, interconnected networks to help minimize traffic. addresses, thereby defining which part of the IP address belongs to
the device and which part belongs to the network
• The “255” address is always assigned to a broadcast address, and the
“0” address is always assigned to a network address
33 34
Question 01 Question 02
• Organization want to develop four networks named network A, • Organization want to develop eight networks. An organization can use
Network B, Network C and network D. Organization can use the 193.40.20.0 IP address for that
195.20.30.0 IP address for that • What is the IP address class?
• What is the IP address class? • What are the network addresses of eight subnetworks?
• What are the network addresses of four subnetworks? • What are the first host IP address of eight subnetworks?
• What are the first host IP address of four subnetworks? • What are the last host IP address of eight subnetworks?
• What are the last host IP address of four subnetworks? • What are the broadcast IP addresses?
• What are the broadcast IP addresses? • What is the subnet mask of the network?
• What is the subnet mask of the network? • How many hosts are in one network?
• How many hosts are in one network?
35 36
Question 03 Question 04
• 192.50.20.0/26 • Identify the subnet of devices with following IP addresses ?
• How many bits are taken to create subnets from the host side? • 192.10.12.66/27
• How many maximum subnets can create by using the above IP address? • 204.15.5.42/27
• How many hosts in each subnet?
• 172.16.98.12/20
• What is the subnet mask?
• 192.168.123.73/26
• 185.60.0.0/22
• How many bits are taken to create subnets from the host side?
• How many maximum subnets can create by using the above IP address?
• How many hosts in each subnet?
• What is the subnet mask?
37 38
Question 05 Routing
• 190.60.132.130/23 • Static routing and dynamic routing are two methods used to
• What is the IP address class? determine how to send a packet toward its destination.
• What is the subnet IP address? • Static Routing
• What is the host range between in above IP address? • In static routing, the routes show the path between two routers that cannot
• What is the broadcast IP address? be updated automatically.
• How many maximum subnets can create by using the above IP address? • The path is manually updated
• What is the subnet mask? • Static routing uses small routing tables with only one entry for each
destination. It also requires less computation time than dynamic routing
because each route is preconfigured.
• Network administrators must add and delete to reflect any network topology
changes
39 40
Routing Routing Algorithms
• Dynamic Routing • Objective of routing algorithms is to calculate ‘good’ routes.
• Sometimes called adaptive routing, is more complex than static routing • Routing algorithms for both datagrams and virtual circuits should
because it creates more possible routes to send packets across a network. satisfy;
• Dynamic routing uses algorithms to compute multiple possible routes and
• Correctness
determine the best path for traffic to travel through the network.
• Simplicity
• It uses two types of complex algorithms: distance vector protocols and link
state protocols. • Robustness
• Stability
• Fairness
• Optimality
• Impossible to satisfy everything at the same time.
41 42
43 44
• Link State Routing
• Each node knows the distance to its neighbours.
Link State Routing Distance vector Routing
• The distance information (=link state) is broadcast to all nodes in the network. Nodes knows distance to its neighbours Nodes knows distance to its derectly connected
• Each node calculates the routing tables independently. neighbours
• Distance Vector Routing The distance information is broadcast Node sends list to its neighbours with the current
distances to all nodes
• Each node knows the distance (=cost) to its directly connected neighbours. Each node calculate routing table indipendantly Routing table automatically update
• A node sends a list to its neighbours with the current distances to all nodes.
• If all nodes update their distances, the routing tables eventually converge.
45 46
Dijkstra’s Algorithm
• The Dijkstra's algorithm finds the shortest path from a particular
node, called the source node to every other node in a connected
graph.
• It produces a shortest path tree with the source node as the root.
• It is profoundly used in computer networks to generate optimal
routes with the aim of minimizing routing costs.
47 48
Calculate the shortest path
49 50