fundamentals of computer networks ece 478/578 · 2011. 2. 2. · eee 448 computer networks with...

10
1/30/2017 1 Lecture #2 Dept of Electrical and Electronics Engineering Çukurova University EEE 448 Computer Networks with (Network Programming) Organizing Network Functionality 2 Networks are built from many components Networking technologies Ethernet, Wifi, Bluetooth, Fiber Optic, Cable Modem, DSL Network styles Circuit switch, packet switch Wired, Wireless, Optical, Satellite Applications Email, Web, FTP, Bittorrent, Skype How do we make all this stuff work together?! Problem Scenario 3 Web Email Bittorrent Ethernet 802.11 Bluetooth VoIP Cellular This is a nightmare scenario Huge amounts of work to add new apps or media Limits growth and adoption More Problems 4 Bittorrent Ethernet 802.11 Bittorrent Application endpoints may not be on the same media 5 How does the Internet Look Like? Key Questions 6 How do we divide functionality into layers? Routing Congestion control Error checking How do we distribute functionality across devices? Example: who is responsible for security? Switch Switch Router Security Fairness And many more…

Upload: others

Post on 07-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

1

Lecture #2

Dept of Electrical and Electronics Engineering

Çukurova University

EEE 448 Computer Networks

with

(Network Programming)

Organizing Network Functionality

2

• Networks are built from many components

– Networking technologies

• Ethernet, Wifi, Bluetooth, Fiber Optic, Cable Modem, DSL

– Network styles

• Circuit switch, packet switch

• Wired, Wireless, Optical, Satellite

– Applications

• Email, Web, FTP, Bittorrent, Skype

• How do we make all this stuff work together?!

Problem Scenario

3

Web Email Bittorrent

Ethernet 802.11 Bluetooth

VoIP

Cellular

• This is a nightmare scenario

• Huge amounts of work to add new apps or media

• Limits growth and adoption

More Problems

4

Bittorrent

Ethernet 802.11

Bittorrent

Application endpoints

may not be on the

same media

5

How does the Internet Look Like? Key Questions

6

• How do we divide functionality into layers?

– Routing

– Congestion control

– Error checking

• How do we distribute functionality across devices?

– Example: who is responsible for security?

Switch Switch Router

Security

Fairness

And many more…

Page 2: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

2

Common Services

Many applications may share common functionalities

Can you think of examples?

These functionalities need to be integrated on each application

Or be abstracted in common services

7

Layering Abstraction Layer: A set of functionalities encapsulated in an object that can be used by other network components

Example: The network layer implements the end-to-end (E2E) packet delivery

Why layering? Think complexity and common services

Layers consist of protocols

8

9

What are Protocols?

• An agreement between parties on how communication should take place

• Module in layered structure

• Protocols define: – Interface to higher layers (API)

– Interface to peer (syntax & semantics)

• Actions taken on receipt of a messages

• Format and order of messages • Error handling, termination,

ordering of requests, etc.

• Example: Buying airline ticket

Friendly greeting

Muttered reply

Destination?

Istanbul

Thank you

10

Layering

• Example:

Link hardware

Host-to-host connectivity

Application-to-application channels

Application

Layered Network Stack

11

• Modularity – Does not specify an implementation – Instead, tells us how to organize

functionality

• Encapsulation – Interfaces define cross-layer interaction – Layers only rely on those below them

• Flexibility – Reuse of code across the network – Module implementations may change

• Unfortunately, there are tradeoffs – Interfaces hide information – As we will see, may hurt performance…

Applications

Physical Media

Layer N

Layer 1

Layer 2

12

Layering Characteristics

• Each layer relies on services from layer below and exports services to layer above

• Interface defines interaction with peer on other hosts

• Hides implementation - layers can change without disturbing other layers (black box)

Page 3: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

3

A simple layering example RRP: Request/reply protocol

MSP: Message streaming protocol

HHP: Host-to-host protocol

13

Looking into layers a bit closer

Protocols in each layer have

Service interface with upper layer/lower layer

Peer-to-peer interface with host on same layer

14

The ISO OSI Model

15

OSI: Open Systems Interconnect Model

Application

Presentation

Session

Transport

Network

Data Link

Physical

Network

Data Link

Application

Presentation

Session

Transport

Network

Data Link

Physical

Host 1 Switch Host 2

Physical

All devices implement

the first three layers Layers communicate

peer-to-peer

Layers communicate

peer-to-peer

ISO: International Organization for Standardization

The Layers Features

16

• Purpose

– Why do you need this layer?

• Service

– What does this layer do?

• Interface

– How do you access this layer?

• Protocol

– How is this layer implemented?

Application

Presentation

Session

Transport

Network

Data Link

Physical

Physical Layer

17

• Purpose – Deals with the transmission of 0s and

1s over the physical media • Translation of bits into signals

• Service – Move information between two

systems connected by a physical link

• Interface – Specifies how to send one bit

• Protocol – Encoding scheme for one bit – Voltage levels – Timing of signals

• Examples: coaxial cable, fiber optics, radio frequency transmitters

Application

Presentation

Session

Transport

Network

Data Link

Physical

Data Link Layer

18

• Purpose – Manages the flow of data over the physical

media – Responsible for error-free transmission

over the physical media

• Service – Data framing: boundaries between packets – Media access control (MAC) – Per-hop reliability and flow-control

• Interface – Send one packet between two hosts

connected to the same media

• Protocol – Physical addressing (e.g. MAC address)

• Examples: Ethernet, Wifi, DOCSIS

Application

Presentation

Session

Transport

Network

Data Link

Physical

Page 4: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

4

Network Layer

19

• Purpose – Addressing and routing the packets – Example application at the router – If the packet size is large, splits into small

packets

• Service – Deliver packets across the network – Handle fragmentation/reassembly – Packet scheduling – Buffer management

• Interface – Send one packet to a specific destination

• Protocol – Define globally unique addresses – Maintain routing tables

• Example: Internet Protocol (IP), IPv6

Application

Presentation

Session

Transport

Network

Data Link

Physical

Transport Layer

20

• Purpose – Repackage proper and efficient delivery of

packages • Error free, In sequence, Without duplication

• Service – Multiplexing/demultiplexing – Congestion control – Reliable, in-order delivery

• Interface – Send message to a destination

• Protocol – Port numbers – Reliability/error correction – Flow-control information

• Examples: UDP, TCP

Application

Presentation

Session

Transport

Network

Data Link

Physical

Session Layer

21

• Purpose

– Oversee a communication session

• Establish, Maintain, Terminate

• Service

– Access management

– Synchronization

• Interface

– It depends-NFS (Network File System)

• Protocol

– Token management

– Insert checkpoints

• Examples: none

Application

Presentation

Session

Transport

Network

Data Link

Physical

Presentation Layer

22

• Purpose – Formats data for exchange between points

of communication • Ex: Between nodes in a network

• Service – Convert data between different

representations – E.g. big endian to little endian – E.g. ASCII to Unicode

• Interface – It depends(PICT ,TIFF ,JPEG ,MIDI ,MPEG)

• Protocol – Define data formats – Apply transformation rules

• Examples: none

Application

Presentation

Session

Transport

Network

Data Link

Physical

Application Layer

23

• Purpose

– User application to network service interface

• Service

– Whatever you want :)

• Interface

– Whatever you want :D

• Protocol

– Whatever you want ;)

• Examples: turn on your smartphone and look at the list of apps

Application

Presentation

Session

Transport

Network

Data Link

Physical

Encapsulation

24

How does data move through the layers?

Application

Presentation

Session

Transport

Network

Data Link

Physical

Data

Data

Page 5: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

5

Encapsulation Example The process of embedding a header or trailer

25

Real Life Analogy

26 Postal Service

Label contains

routing info Un-packing

Doesn’t know

contents of letter

Doesn’t know how the

Postal network works

Network Stack in Practice

27

Application

Presentation

Session

Transport

Network

Data Link

Physical

Network

Data Link

Application

Presentation

Session

Transport

Network

Data Link

Physical

Host 1 Switch Host 2

Physical

Video Client

UDP

Video Server

UDP

FTP Client

TCP

IP

Ethernet

IP

Ethernet

FTP Server

TCP

IP

Ethernet 802.11n 802.11n 802.11n

Encapsulation, Revisited

28

Web Server

TCP

IP

Ethernet

HTTP Header

TCP Header

IP Header

Ethernet Header

Ethernet Trailer

Web Page

HTTP Header

Web Page

TCP Header

HTTP Header

Web Page

IP Header

TCP Header

HTTP Header

Web Page

TCP Segment

IP Datagram

Ethernet Frame

The Hourglass

29

IPv4

TCP, UDP, ICMP

HTTP, FTP, RTP, IMAP, Jabber, …

Ethernet, 802.11x, DOCSIS, …

Fiber, Coax, Twisted Pair, Radio, …

• One Internet layer means all networks interoperate

• All applications function on all networks

• Room for development above and below IP

• But, changing IP is insanely hard

Think about the

difficulty of

deploying IPv6…

Orthogonal Planes

30

Application

Presentation

Session

Transport

IP

Data Link

Physical

Data Plane

BGP RIP OSPF Control Plane

Well cover

this later…

Page 6: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

6

Reality Check

31

• The layered abstraction is very nice

• Does it hold in reality?

No.

Firewalls

Analyze application layer headers

Transparent Proxies

Simulate application endpoints within the network

NATs

Break end-to-end network reachability

Where to Place Functionality

32

• How do we distribute functionality across devices?

– Example: who is responsible for security?

Switch Switch Router

? ?

? ?

?

“The End-to-End Arguments in System Design”

Saltzer, Reed, and Clark

The Sacred Text of the Internet

Endlessly debated by researchers and engineers

Basic Observation

33

• Some applications have end-to-end requirements

– Security, reliability, etc.

• Implementing this stuff inside the network is hard

– Every step along the way must be fail-proof

• End hosts…

– Can’t depend on the network

– Can satisfy these requirements without network level support

Example: Reliable File Transfer

34

Solution 1: Make the network reliable

Solution 2: App level, end-to-end check, retry on failure

Integrity

Check Integrity

Check

Integrity

Check App has to do a

check anyway!

Example: Reliable File Transfer

35

Solution 1: Make the network reliable

Solution 2: App level, end-to-end check, retry on failure

Please

Retry

Full functionality can

be built at App level

• In-network implementation… Doesn’t reduce host complexity

Does increase network complexity

Increased overhead for apps that don’t need functionality

• But, in-network performance may be better

Moderate Interpretation

36

• Think twice before implementing functionality in the network

• If hosts can implement functionality correctly, implement it a lower layer only as a performance enhancement

• But do so only if it does not impose burden on applications that do not require that functionality

Page 7: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

7

37

The Internet Engineering Task Force

• Standardization is key to network interoperability – The hardware/software of communicating parties are often not built

by the same vendor yet they can communicate because they use the same protocol

• Internet Engineering Task Force – Based on working groups that focus on specific issues

• Request for Comments – Document that provides information or defines standard – Requests feedback from the community

– Can be “promoted” to standard under certain conditions • consensus in the committee • interoperating implementations

The Internet Architecture

39

The Internet Architecture

Ethernet FDDI

FTP HTTP TFTP

TCP

DNS

UDP

IP

Net 1 Net 1

FTP: File Transfer Protocol

HTTP: Hypertext Transport Protocol

TFTP: Trivial File Transfer Protocol

TCP: Transmission Control Protocol

UDP: User Datagram Protocol

IP: Internet Protocol

40

TCP/IP Model

Application Layer Application programs using the network

Transport Layer (TCP/UDP)

Management of end-to-end message transmission,

error detection and error correction

Network Layer (IP)

Handling of datagrams : routing and congestion

Data Link Layer Management of cost effective and reliable data delivery,

access to physical networks

Physical Layer

Physical Media

Comparison of the two architectures

42 43

hardware interface

TCP

IP

UDP

user processor

user processor

OSI Layer 5-7

OSI Layer 4

OSI Layer 3

OSI Layer 1-2

ARP ICMP RARP

UDP: User Datagram Protocol: ICMP: Internet Control Message Protocol IP: Internet Protocol ARP: Address Resolution Protocol RARP: Reverse ARP

Network Structure

Page 8: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

8

44

Port Number

user proc.A

user proc.B

user proc.C

user proc.D

user proc.E

user proc.F

user proc.G

IDP IP

SPP PEX TCP UDP

Ethernet interface

Ethernet interface

Ethernet interface

Ethernet interface

TCP/IP protocol suite

XNS protocol suite

Ethernet cable 2

Ethernet cable 1

45

Hierarchical Addressing Scheme

• Connection defines the communication link between two processes

data

data UDP header

data UDP header

IP header

UDP header

data IP header

Ethernet trailer

Ethernet header

16-bit UDP source port # 16-bit UDP dest. port #

protocol = UDP internet 32-bit source addr internet 32-bit dest. addr

frame type = IP Ethernet 48-bit source addr Ethernet 48-bit dest. addr

Ethernet frame

UDP = User

Datagram Protocol

The Physical Layer

• defines the mechanical, electrical, and timing interfaces to the network.

– theoretical analysis of data transmission

– three kinds of transmission media :

• guided : copper wire and fiber optics

• Wireless: terrestrial radio

• satellite

Physical layer

47

To be transmitted, data must be transformed to electromagnetic signals.

Physical layer: The Theoretical Basis

• Information can be transmitted on wires by varying some physical property such as voltage or current.

• we can model the behavior of the signal and analyze it mathematically (f(t))

• Fourier Analysis : – periodic function, g(t) with period T can be constructed as the sum of a

(possibly infinite) number of sines and cosines:

Physical layer: The Theoretical Basis

• A data signal that has a finite duration (which all of them do) can be handled by just imagining that it repeats the entire pattern over and over forever.

• Computation of series coefficients :

Page 9: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

9

Physical layer: The Theoretical Basis

• Bandwidth-Limited Signals

– example: the transmission of the ASCII character ''b''

encoded in an 8-bit byte.

• bit pattern : 01100010

• Root-mean-square:

Physical layer: The Theoretical Basis

– all transmission facilities diminish different Fourier components by different amounts, thus introducing distortion.

– Usually, the amplitudes are transmitted undiminished from 0 up to some frequency fc [measured in cycles/sec or Hertz (Hz)] with all frequencies above this cutoff frequency attenuated.

– The range of frequencies transmitted without being strongly attenuated is called the bandwidth (0 - fc )

– The bandwidth is a physical property of the transmission medium and usually depends on the construction, thickness, and length of the medium

Physical layer: The Theoretical Basis

– The number of the highest harmonic passed through is roughly 3000/(b/8) or 24,000/b

– Relation between data rate and harmonics :

Guided Transmission Media

• Magnetic Media – Bandwidth characteristics is excellent

– Delay characteristics is poor

• Twisted Pair – A twisted pair consists of two insulated copper wires, typically about

1 mm thick.

– Twisting is done because two parallel wires constitute a fine antenna.

– Twisted pair categories: • Category 3 UTP (Unshielded Twisted Pair) (a)

• Category 5 UTP (Unshielded Twisted Pair) (b) – They are similar to category 3 pairs, but with more twists per centimeter, which results in less

crosstalk and a better-quality signal over longer distances, making them more suitable for high-speed computer communication.

Coaxial Cable

• It has better shielding than twisted pairs, so it can span longer distances at higher speeds.

• Two kinds of coaxial cable • 50-ohm cable : is commonly used when it is intended for digital

transmission.

• 75-ohm cable: is commonly used for analog transmission and cable television

• The bandwidth possible depends on the cable quality, length, and

signal-to-noise ratio of the data signal.

Fiber Optics

– An optical transmission system has three key components:

• Light source: Conventionally, a pulse of light indicates a 1 bit and the absence of light indicates a 0 bit.

• Transmission medium: is an ultra-thin fiber of glass

• Detector: generates an electrical pulse when light falls on it.

Page 10: Fundamentals of Computer Networks ECE 478/578 · 2011. 2. 2. · EEE 448 Computer Networks with (Network Programming) ... • we can model the behavior of the signal and analyze it

1/30/2017

10

Fiber Optics – When a light ray passes from one medium to another, for

example, from fused silica to air, the ray is refracted (bent) at the silica/air boundary

– Fiber types

• multimode fiber

• single-mode fiber: diameter is reduced to a few wavelengths of light

Fiber Optics

• Fiber Cables – multimode fibers : The core is typically 50 microns in

diameter, about the thickness of a human hair

– single-mode fibers : The core is 8 to 10 microns.

Fiber Optics – Fibers can be connected

in three different ways • Connectors

• Mechanical

• Fusion

– Two kinds of light sources are typically used to do the signaling

• LEDs (Light Emitting Diodes)

• Semiconductor lasers

– receiving end of an optical fiber consists of a photodiode

A comparison of semiconductor diodes and LEDs as light sources.

Comparison of Fiber Optics and Copper Wire

• Fiber can handle much higher bandwidths than copper,

• Fiber not being affected by power surges, electromagnetic interference, or power failures,

• Fiber is thin and lightweight,

• Security in fiber is high,

• Fiber is a less familiar technology requiring skills not all engineers have,

• Fibers can be damaged easily by being bent too much,

• Optical transmission is inherently unidirectional, two-way communication requires either two fibers or two frequency bands on one fiber,

• Fiber interfaces cost more than electrical interfaces ……..

Last words

60

• Layering is a nice way to organize network functions

• Unified Internet layer decouples apps, enables innovation

• E2E argument (attempts) to keep IP layer simple

• Think carefully when adding functionality into the network