Lecture2-Part1

Download Report

Transcript Lecture2-Part1

ELEG 651 / CPEG 419
Introduction to Data Networking
Review of Lecture 1 and
continuation of chapter 1
Announcements
• Homework 1 due next week
• Project 1 due next week
Today
• Recent News
• Review and complete Chapter 1
• Start Chapter 2
In the news
News sources
www.lightreading.com (general networks)
www.unstrung.com (wireless and mobile)
www.darkreading.com (network security)
www.alleyinsider.com (general tech business news)
arstechnica.com (general tech news)
Comcast Defends P2P Management
http://www.lightreading.com/document.asp?doc_id=146016&site=cdn
•
P2P file sharing is responsible for a
– large share to the bytes send over the Internet,
– but only a small fraction of the connections
•
•
Thus, a few P2P users are using most of the bandwidth
ISPs would rather give good service to users other than to P2P users
– If a transfer of a large file takes a bit longer, it does not impact the utility (the user
does not really care)
– If a short file transfer takes longer, it greatly impact utility (delaying a web page or
a VoIP packet is a big problem for a user)
– Ideally, service is provided according to user utility, more utility results in more
bandwidth
•
Possibly, Comcast uses equipment to ensure that short connections receive
the maximum possible bandwidth at the expense of long connections.
– Comcast denies this
•
Some claim that Comcast cut P2P connections in general
– This seems doubtful
•
P2P users claim that comcast is not abiding by network neutrality
network neutrality
•
•
•
•
Net neutrality is about allowing any type of connections and providing the
same type of service with any decimation.
Depending on your prospective, it is a good idea or bad idea.
Google likes the idea that they do not have to do anything special to get
bandwidth
ISPs and some application developers are against net neutrality
– Suppose that an ISP allows cheap or free access but charges google for
searches. If google does not want to pay, then the ISP directs searches to yahoo,
microsoft, or ask.com
• Would you rather get free access or ensure that all your searches go where you want.
• Google is very afraid of lack of customer loyalty.
– Net-flex and amazon and others would like to sell video over the network.
However, the network is too slow. They might be willing to pay for a faster
service.
• Net neutrality is blamed for a lack of video on-demand
•
Politically motivated censoring
– google.cn and china in general blocks network content that is against Chinese
government
– There is little doubt that without net neutrality, if Rupert Murdock (the owner of
fox tv) owned an ISP, he would block access to web sites with non-conservative
viewpoints
•
There have been several attempts to pass net neutrality laws (one is
currently pending), but so far, net neutrality is not a law
– The comcast vs P2P is being used to motivate the current bill
The Protocol Stack
application
transport
network
link
physical
• The application layer includes
network applications and network
application protocols
– e.g. of applications: web, IM, email
– e.g., application protocols: OSCAR,
http, smtp, ftp, DNS.
• Provide a service to a user or
another application.
• Require service from the lower
layers, but typically only interact
with the transport layer.
The Protocol Stack
application
•
The transport layer (typically) :
•
Different transport layer protocols provide different
types of services.
Types of services MAY include
•
–
–
–
–
–
–
–
–
transport
network
link
physical
•
Note that when a transport protocol provides these
services, the application does not have to.
–
–
•
This makes implementation of applications easier.
This allows careful design of transport protocols,
following the divide and conquer approach
The transport layer uses the network layer to deliver
packets, but does not require any type of service
guarantees from the network layer
–
In practice, the transport layer hopes for in order
delivery.
Transport layer protocols: TCP and UDP
•
application
transport
•
•
•
–
–
–
–
–
network
link
TCP and UDP are the most widely used
transport protocols.
Other protocols include SCTP (UD and Cisco
are active in developing SCTP), RTP (for
multimedia such as VoIP)
TCP and UDP will be covered in great detail
later. But for now:
TCP provides many services
•
UDP provides few services
–
–
–
physical
•
TCP requires a connection to be established,
UDP does not
Transport Multiplexing
• Transport layers use
ports to provide
multiplexing
– A two hosts can have
multiple simultaneous
connections by using ports.
– Well known ports can be
used to specify a particular
application
• E.g., web servers will
accept TCP connections
on port 80
• A host can have two
connections with a web
server by using different
ports
host
(web server)
host
TCP
UDP
TCP
UDP
0
0
0
0
4567
4568
216-1
80
216-1
216-1
216-1
Sockets – gateway between the app layer and the
transport layer
• process sends/receives
messages to/from its socket
• socket analogous to door
– sending process shoves
message out door
– sending process relies on
transport infrastructure on
other side of door which brings
message to socket at
receiving process
host or
server
host or
server
process
controlled by
app developer
process
socket
socket
TCP with
buffers,
variables
Internet
controlled
by OS
TCP with
buffers,
variables
TCP Sockets
•
•
•
An application accesses TCP and UDP through sockets.
TCP is connection based so one host must be listening and the other must
be connecting (calling)
The basic steps for a TCP listener
– Define socket variable as a TCP socket
– Bind socket to a port (the bind function)
• If some other application is or was recently (120 sec) listening on this port, this function
will fail.
• The application must check that this command succeeds.
– Listen on this port (the listen function)
– When a the other host connects, the listen function completes and data can be
send or received.
– Close socket
•
Basic steps for TCP caller
– Define socket variable as a TCP socket
• No port is given, the OS will assign which ever port is available. The application has no
control over the port
– Connect
– Send data
– Close socket
UDP Sockets
•
UDP are connectionless.
–
–
–
•
A host sends a packet when it wants.
There is no concept of one host connecting to another.
There is only the concept of one host sending a packet and the other host receiving the
packet. And either host can send or receive
Steps to send and then receive a UDP message
–
–
Define socket as a UDP socket
Bind socket to a port
•
–
–
Send message
Wait for message
•
•
•
•
–
•
If this port is in use, bind will fail
There are two ways to wait for messages, blocking or non-blocking
A blocking function will wait for a message to arrive. It might wait forever.
A non-blocking will return immediately, but if no message was waiting in the transport layer, then no
message is returned
select function allows a time out to be set. So the function will wait until a message arrives or the
timeout time to elapse.
Close socket
Steps to receive a UDP message
–
–
Define socket as a UDP socket
Bind socket to a port
•
–
–
–
If this port is in use, bind will fail
Send message
Wait for response
Close socket
Project 1
Due 2/25
• In this project messages will be sent over TCP and UDP.
• The project is description currently at
– www.eecis.udel.edu/~bohacek/Classes/ELEG651Spring2008/Pr
oject1/Project1.htm
• Once mycourses is up, it will be listed there.
• All the required information should be online. Post
questions on mycourses (if it is up)
• This project can be completed by cut and pasting from
the web site. But try to understand the steps.
• Let me know if there are typos.
The Protocol Stack
• The network layer
application
transport
network
link
physical
• The network layer gets packets
from the transport layer or from the
link layer.
• Depending on the destination
address, the network layer will give
the packet to the transport protocol
or to a specific link layer to send on
a specific link
• The network layer also provides
fragmenting of a large packet into
chunks suitable for the link layer
The Protocol Stack
application
transport
network
link
physical
• The link layer moves packets
(frames) between two hosts
• However, the link layer may
provide a wide range of services
including
–
–
–
–
The Protocol Stack
• The physical layer
application
transport
network
link
physical
• This requires putting the bits onto a
physical medium and decoding
them from the medium.
• In this course we mostly neglect
the physical layer and assume that
is works correctly (each layer
always assumes that the other
layers work correctly)
• But the performance of a protocol
at a layer often dependent on the
other layers.
– One approach is for cross-layer design
source
message
segment
M
Ht
M
datagram Hn Ht
M
frame Hl Hn Ht
M
Encapsulation
application
transport
network
link
physical
link
physical
switch
destination
M
Ht
M
Hn Ht
Hl Hn Ht
M
M
application
transport
network
link
physical
Hn Ht
Hl Hn Ht
M
M
network
link
physical
Hn Ht
M
router
Packet Switching vs. Circuit Switching
• Packet switching
• Circuit switching
• Circuit switching might lead to
• Packet switching leads to
The delay goes to infinity at utilization goes to 1
Discrete-time queuing theory – Markov Chains
Suppose that at each time step either
1. The queue increases by length one with probability p
2. If the queue is not empty, it decreases by length 1 with probability q = 1 – p
3. If the queue is empty, then it stays empty with probability q = 1 - p
Diagram of the states the queue can take
Required for ELEG 651 but optional for CPEG 419
The delay goes to infinity at utilization goes to 1
Discrete-time queuing theory – Markov Chains
Suppose that at each time step either
1. The queue increases by length one with probability p
2. If the queue is not empty, it decreases by length 1 with probability q = 1 – p
3. If the queue is empty, then it stays empty with probability q = 1 - p
Diagram of the states the queue can take
Required for ELEG 651 but optional for CPEG 419
The delay goes to infinity at utilization goes to 1
p
q
Q=0
(empty)
p
Q=1
q
p
Q=2
q
p
Q=i-1
q
p
Q=i
q
Q=i+1
q
Define P(i) to be the probability that the queue has i packets
Required for ELEG 651 but optional for CPEG 419
p
q
The delay goes to infinity at utilization goes to 1
Required for ELEG 651 but optional for CPEG 419
The delay goes to infinity at utilization goes to 1
Required for ELEG 651 but optional for CPEG 419
The delay goes to infinity at utilization goes to 1
Expected queue occupancy
Required for ELEG 651 but optional for CPEG 419
The delay goes to infinity at utilization goes to 1
Required for ELEG 651 but optional for CPEG 419
Delay in Packet Networks
Types of delay in packet networks
1.
2.
3.
4.