Date post: | 26-Dec-2015 |
Category: |
Documents |
Upload: | sheryl-powell |
View: | 218 times |
Download: | 1 times |
19-1
Computer Networking
19-2
Goal of a Network
• Network: A collection connected entities– Refer to each entity in the network by the name “node”
• generic name given to any device in a network.
– The goal of a network is to allow nodes in the network to communicate in some way
• thinking concretely:– nodes computers– communication transfer of bits
– If computers are networked, we can communicate anything that can be represented in binary
• Text, Images, Sound, Video, Programs, etc...
– to facilitate such a network in abstract terms we need...
19-3
The Internet Hourglass Model
• The physical layer is how machines are physically connected to each other . . .
FTP HTTP NV TFTP
TCP UDP
IP
Token Ring
Wi-fi (802.11
)
Ethernet
InterNetwork
Transport
Application
Physical
19-4
Sending data on the physical layer
• To send a packet to another computer on the LAN (local area network)
– I set the source and destination of the frame accordingly (the destination is the MAC address of the computer I want to reach)
– I send the frame out on the wire (I send the bits to my network interface card which will turn those bits into voltage pulses for me and send them on the wire)
A
EB C
D
• All other connected network interfaces on my local network “see” the frame go across the wire
– Because they each know the protocol they will be able to tell one packet from another– Only the node with the same MAC address as the destination will accept the frame– Other network interfaces will ignore the frame, because it is not addressed to them
19-5
Communication Basics of Networks
• Computers can be connected physically or via wireless connections– a physical connection.
• Physically connect computers together.– Use of wires or optical cables.
• Three most common physical links:– Twisted pair – Coaxial cable– Fiber-optic cable
• Twisted pair– Two wires twisted together.
• Makes them less susceptible interference:– unwound cable will act like an antenna and picking up radio frequency
information or appliance noise.– Telephone company uses twisted-pair copper wires to link telephones.
19-6
Communication Basics of Networks
• Coaxial cable– Also two wires:
• One of the wires is woven of fine strands of copper forming a tube.
• The wire mesh surrounds a solid copper wire that runs down the center.
• Space between has a non-conducting material.
• Makes them less susceptible to outside noise.
• Cable companies use coax
19-7
Communication Basics of Networks
• Fiber-optic cable– Light is fast.
– Light can travel faster than power can travel along a wire
– Can transmit more information down a single strand.
• It can send a wider set of frequencies.
– Each cable can send several thousand phone conversations or computer communications.
– Fiber tends to have distance limitations
19-8
Communication Basics of Networks
• Wireless connections– The link is made using electromagnetic energy that travels over the air
instead of along wires or cables.
– Three types of wireless communications commonly used in networking…
• Infrared (IR)
– Commonly used in TV and VCR remote controls.
– Use infrared frequencies of electromagnetic radiation that behave much like visible light.
– line of sight required.
– Often used to connect keyboards, mice, PDAs, etc
19-9
Communication Basics of Networks
• Radio frequency (RF)– Uses radio frequencies to transmit data
• Function even though line of sight is interrupted.– Interference is a problem with these technologies…most
use 2.4Ghz radio band (as Microwaves, Cordless Phones)– Used in Apple Airport/WiFi (802.11b), Airport Extreme
(802.11g), and Bluetooth• Microwave
– Often used to communicate with distant locations.– Must be line of sight.– Satellite communications use microwaves.
19-10
The Internet Hourglass Model
• The physical layer is how machines are physically connected to each other . . .
FTP HTTP NV TFTP
TCP UDP
IP
Token Ring
Wi-fi (802.11
)
Ethernet
InterNetwork
Transport
Application
Physical
19-11
The Internet is growing. . .
• Seeds of Networking– 1966: ARPA (Advanced Research Projects Agency) State Defense
Department’s research organization.
• Focused major development effort on computer networking.
• ARPA’s Goal: To promote research in advanced future technologies by funding university and industry research proposals.
• Result: Thousands of databases became available to the public.
– 1969 ARPAnet connects four universities – this will eventually grow into the Internet
19-12
Motivating the Inter-Network Layer
• The physical layer does a lot, but it leaves a lot to be desired:– A mechanism to send packets off the LAN, to a computer on a different LAN
• Can we just do the LAN thing (broadcast) across all computers?
– would it make sense to broadcast every message to the entire Internet?
– A new addressing convention that indicates something about hierarchy (even though we have no idea where physical machines are)
• Some programs that allow discovering the addresses of computers you’d like to communicate with
– Protocols that can be supported by any kind of computer, regardless of your LAN's protocol
– Fundamentally, bridge different LANs.
• IP: The Internet Protocol
19-13
The inter-network layer
• The inter-network layer is what allows all machines on the Internet to communicate with each other
– (Notice that many different protocols exist above/below IP, but they all converge to IP – this is how all computers can communicate over the Internet!)
FTP HTTP NV TFTP
TCP UDP
IP
Token Ring
Wi-fi (802.11
)
Ethernet
InterNetwork
Transport
Application
Physical
19-14
Sending data across LANs
LAN “1”
LAN “2”
cD
computer connected to more than one LAN
A B C
a
b
computers
computers
19-15
measuring speed
• A given physical connection technology has a bandwidth: maximum bits per second on a link
– Bandwidths are usually in bits per second (or Kbits per second, or Mbits per second), unless otherwise specified.
– Think of it as “the maximum data rate you could possibly receive if you were the only person using the link”
– In practice, you won’t see that maximum bandwidth at all times• Why? Other users.
– The effective bandwidth is actually the bandwidth that you actually get at a given point in time.
• I have a 10KBps link to my LAN, but my transfer across the internet is only 2KBps.
• What is my effective bandwidth for this transfer?• Also, why did this happen??
19-16
bandwidth (cont'd)
• The effective bandwidth is calculated on a per-transfer basis. – It’s not necessarily my fault if I get a slow stream of data from some host
D on Network C• the delay could happen anywhere on the path from A to D (between A and
Network C, on the link between D and C, or in the path along the Internet).
– Effective bandwidth is limited by the slowest link in a path.
InternetA's
router
A
C
D
19-17
Sending data across networks
• Knowing this, we can make deductions about “expected” effective bandwidth if we look at the bandwidth of the complete path for a transfer
– What is the maximum possible effective bandwidth between Host A and Host D given this picture?
• KB = Kbytes
• Kb = Kbits
8Kbps
10KBps100KBps Internet
B
A
D
19-18
Sending data across networks
• I pay for a DSL connection with up to 10Mbits/s bandwidth, and it just took me 30 minutes to download 180MByte file.
– What is my effective bandwidth for this transfer?
– What percentage is my effective bandwidth of my maximum bandwidth?
– What assumptions can we make about the unknown bandwidths?
• Effective bandwidth is limited by the slowest link in a path.
10MbpsInternet
B
A
C
D
19-19
Motivating the Inter-Network Layer
• We’d like our messages to be able to leave our local area network and head out to other LANs
• MAC addresses are clearly useful, but they don’t tell us how to “route a call”
– Think about phone numbers• (AREA CODE) (EXCHANGE) (NUMBER)• The area code indicates the state and region of the state• The exchange identifies which central office in that region the
number belongs to• Finally, the last four digits land a caller at your telephone line
– And there’s some smart switching in the middle that actually routes our calls!
19-20
IP Addresses
• Internet Addressing is done via IP Addresses.• Like a phone number, it’s your computer’s unique hierarchical number
on the Internet
• The IP Address is structured (like a phone number) :– example: 128.196.3.21
– Network = 128.196.3
– Host = 21
• Network indicates the network (LAN) of this address
• Host indicates which specific node on that network
– IP Address assignments are not Geographic
– Each network gets a block of addresses
• based on assignment by InterNIC
• You get an IP address from your Network Provider
19-21
IP Addresses
– An IP Address is 32 bits (read as four 8-bit segments)
• 10000000 11000100 00000011 00000001
• 128.196.3.1
• Range is: [0-255].[0-255].[0-255].[0-255]
128.196.3.23 128.196.3.27
128.196.3.1
128.196.3.35
19-22
Sending data around an internet
128.12.2.*128.12.2.1
Router (default route) for the 128.12.2.* network
128.12.2.64 128.12.2.67 128.12.2.123
nodes
interfaces
• This is a Local Area Network shown at the Internetwork Layer• The physical layer still exists, we just have new names
19-23
Sending data across networks
128.12.2.*
132.65.112.*
132.65.112.1
128.12.2.1
router
128.12.2.64 128.12.2.67 128.12.2.123
132.65.112.18
132.65.112.31
nodes
nodes
19-24
Sending data across networks
• A router is a device that connects multiple networks together. A router has multiple interfaces, connected to different networks. The router is responsible for routing traffic from one network to another.
– The router maintains a routing table, indicating which interface to forward traffic on depending on the destination address
– Each node has a “default route” (who to send it’s traffic to on it’s local network)
– The router on that network then forwards your traffic along to its next “hop” towards final direction
– Each transfer taken by a packet on a router is called a “hop”
– Routing: The act of building a routing table– Forwarding: The act of sending packets on to the next hop as
indicated by the routing table
19-25
Packets (like envelopes)
• The Internet is referred to as a packet-switching network.– Packet: A logical block of information consisting of a header part and
a payload part for transmitting the payload part over a network:– (just like Ethernet frames)
• Packets exist at all layers of the network hierarchy – We’ve already seen Ethernet packets
• The contents of the header and the payload are dictated by the protocol
• Each packet has a header containing information regarding content, where it came from, where it is supposed to go
– Depending on the specific protocol, there will be more information in the packet header.
– Let’s look at an IP packet…• (remember, when these are sent over an Ethernet, they will be the
contents of the “payload” part of an Ethernet frame)
19-26
Sending data around the Internet
• Internet Protocol– IP is the protocol that allows data (packets) to move around the
Internet.
– A packet has a header part and a data part
Version
TTL ChkSumSource Address
Destination Address
Payload
{header
{ data
19-27
Sending data around the Internet
• Payload = data portion of a packet• TTL = Time To Live = the number of hops before a packet is thrown away• Version = version of IP being used (4)• CheckSum = a simple code (read: quick to calculate) used to determine if any
of the bits of the packet have been corrupted in transit (sum of all the bits in the packet)
• Source Address = IP Address of where the packet is coming from• Destination Address = IP Address of where the packet is headed
VersionTTL ChkSum
Source AddressDestination Address
Payload
{header
{ data
19-28
Routing
• Routing: computing the best path between end-points.– We have routers A,B,C,D,E
– Each link between these networks has some cost
• cost could be time, bandwidth, some physical cost ($$), etc
• Each router doesn’t know the whole topography of this graph
E
A
B
C
D
2
10
9
4
5
11
3
• A routing table tells us on which interface to send traffic depending on the destination (hopefully to minimize cost)
•What should a routing table contain?• How are we going to build a routing table??
19-29
Routing
• Distance-Vector algorithm– Tell your immediate neighbors your distance to your immediate neighbors
(distance-vectors), and calculate your cost to get to those neighbors until the distance-vectors converge (stop decreasing).
– distance-vector – the minimum cost path to remote hosts
E
A
B
C
D
2
10
9
4
5
11
3
C
B
Destination
CostNext Hop
2C
10B
19-30
Routing
4D
9C
10A
E
A
B
C
D
2
10
9
4
5
11
3
– In round 1, A’s routing table is:
B
C
B
Destination CostNext Hop
2C
10BA
– A receives: B’s distance vector
• A will follow the following procedure:– If a neighbor is advertising a node I know nothing about, I should add that node
to my routing table
cost to new node = cost to advertising node + cost of advertising node to get the data to new node
– If a cheaper route is now available, update my route to take that route instead
2
19-31
Routing
4D
9C
10A
– In round 1, after processing B, A’s routing table is:
B– A received:
• A will perform the following procedure:– If a neighbor is advertising a node I know nothing about, I should add that node
to my routing table
cost to new node = cost to advertising node + cost of advertising node to get the data to new node
– If a cheaper route is now available, update my route to take that route instead
2CCD
B
Destination CostNext Hop
14 (10+4)
B
10BA
E
A
B
C
D
2
10
9
4
5
11
3
2
19-32
Routing
– In round 1, after processing B, A’s routing table is:
5D
11E
9B
2AC– A receives:
2CC
D
B
Destination CostNext Hop
14B
10BA
– What should A do to its routing table?
E
A
B
C
D
2
10
9
4
5
11
3
2
19-33
Routing
– After round 2, A’s routing table will be:
10BB
7CD
10CE
C
Destination CostNext Hop
2C
A
– How did A get the shorter router to E?
– Note that A doesn’t know the complete route!
• It doesn’t need it, either
• This algorithm relies on the fact that each node will forward the data to the correct next node.
E
A
B
C
D
2
10
9
4
5
11
3
2
19-34
Sending data across networks• As the packet travels through the Internet from network to
network:– Each packet may not travel through the same path through the Internet to
its destination.
• Routes can change through-out the same transmission
• Will packets always arrive in order?
– TTL (Time to Live) and forwarding:• The number is originally set to something large (64).
• Each time it is received by a router, it decrements by 1.
• If the TTL number becomes 0 before reaching its destination:
– The router throws away the packet and the router where this happened sends back an error message (time exceeded) with the address of the router.
– Why throw away packets?
– IP is a best-effort service – packets may get lost!
19-35
IP Addresses
• Do I always get the same IP address?– Not necessarily. . .
• DHCP (dynamic host configuration protocol) allows you to get a different IP address every time you connect to the network
– The network part is the same, but the host address changes– Example:
» Let’s imagine I use Verizon dial-up. » Verizon has a fixed number IP addresses that it could assign to me (all
of them are in the same network space).» I’m not guaranteed to get the same IP address every time I connect …
maybe they’ve over sold their capabilities• Clearly web servers and such need the same IP address all the time, so that people
can know where there are.– Having the same IP address every time you connect is called a “static IP
address” – static; e.g. it doesn’t change.– When it changes, it is called a Dynamic IP Address.
– So, if you want to call a specific computer, you need to know the specific number, right?
• Yes.– Do I need to remember the number of every computer I want to contact?
19-36
IP Addresses and DNS
• Mapping IP Addresses to names.– Humans aren’t good at memorizing numbers, we fair better with names.– Like the phone book, DNS (domain name system) associates hostnames
with IP addresses• www.google.com 216.239.37.99• So we only need to remember www.google.com, and DNS will
translate the name into a number.
• Like IP Addresses, hostnames have a network part and a host part
– Unlike IP Addresses, in DNS, the second part is the Network Part (domain), the first part is the host part.
– www.google.com• google.com = domain• www = host part
– virgil.bu.edu • bu.edu = domain• virgil = host part
19-37
Hostnames
• The right-most portion of the domain is the top-level domain.
– There are two types of top-level domains:• Organizational
– .edu – educational– .com – commercial– .mil - military– .net - network– .org - organization– .gov - government
• Geographic– .uk– .fr– .usa
19-38
DNS
• When nodes have the same domain, they are in the same network:
– virgil.bu.edu
– mail.bu.edu
– csa.bu.edu
• Hostnames tell us a lot; but we still need the IP address of a node
• DNS is a network program that will give us the IP address of a specific hostname.
• Imagine looking for the IP address of virgil.bu.edu.
• We ask the closest domain name server “do you know the IP address of virgil.bu.edu?”
• Could every DNS server know every machine in every domain?
• How do we approach this problem?
19-39
DNS
• Imagine looking for virgil.bu.edu.• We ask the closest domain name server “do you know the
IP address of virgil.bu.edu?”
• I don’t know Virgil, but I do know someone who knows about .bu.edu … let me ask that server. (That server is called a resolver)
• The request gets passed along to the bu nameserver
• That machine responds with the IP Address of Virgil: (128.197.56.79)
• With the IP Address, I can get data to you.
19-40
Physical Layer concerns
• What happens if a frame gets corrupted some other way?– Suppose I hold a magnet over the wire that your transmission is going
over, in an attempt to flip your bits.
– If the data is not the same frame the sender intended to send, it’s not very useful to the recipiant
• This is not a collision so the NIC doesn’t auto-detect this
– We need a simple way of letting the receiver check if this frame is intact
• How can a recipient tell if a frame has errors from the frame it has received?
– CheckSum
19-41
Checksum
– We need a simple way of letting the receiver check if this frame is intact
• How can a recipient tell if a frame has errors from the frame it has received?
• CheckSum construction algorithm:
– Sender: Add all the bits in the frame, which will yield another string of bits (we can calculate this quickly)
• CheckSum/Packet verification algorithm
– Receiver: Add all the bits in the packet and compare to the checksum in the packet.
» Match? Packet is good.
» No? Throw the packet away.– Can we fix flipped bits using a checksum?
19-42
The inter-network layer
FTP HTTP NV TFTP
TCP UDP
IP
Token Ring
Wi-fi (802.11
)
Ethernet
InterNetwork
Transport
Application
Physical
19-43
Motivating the Transport Layer
• The Physical layer allows us to move bits between two computers
• The Internet Protocol (IP) builds on top of this, and enables data to travel across networks on the Internet
• However there is a lot of things that IP doesn’t do. . . – What order are the packets coming in?– As a sender, are there other features we might like?
• Knowledge of whether a packet actually made it to the target• Other communication about the target’s ability to receive more data• Concerns about not flooding (over-utilizing) the network. . .
– Yet, would every network application need all of the above?• Does it make sense to “force” this functionality on all network
communications?• What would be the apparent cost of adding such features?
– More bits = more data to send = time
19-44
Motivating the Transport Layer
Web Browser
File Transfer
Instant Messenger
IP Packet
• IP allows us move packets from one computer on the Internet to any other computer on the Internet.
• What if multiple programs want to use the network ?
IP Packet
IP Packet
Which packets go to which application !?!
Packet
19-45
Motivating the Transport Layer
Web Browser
File Transfer
Instant Messenger
IP Packet
• IP allows us move packets from one computer on the Internet to any other computer on the Internet.
• What if multiple programs want to use the network ?
IP Packet
IP Packet
Which packets go to which application !?!
Packet