Lecture #3 & 4 Fundamentals of Computer Networks
Lecture #3 & 4 Fundamentals of Computer Networks
WHAT IS A NETWORK?
• A network is simply two or more computers
that are linked together.
• The most common types of networks are:
Local Area Networks (LANS) and
Wide Area Networks (WANS).
• The primary difference between the two is
that a LAN is generally confined to a limited
geographical area, whereas a WAN covers a
large geographical area. Most WANs are
made up of several connected LANs.
TYPES OF NETWORKS
• Local Area Network (LAN) – a network that
spans a small area such as a building or an office.
▫ Software applications and other resources are stored on a file
server.
▫ Print servers enable multiple users to share the same
printer.
• Wide Area Network (WAN) – a network that
spans a wide geographical area;
BENEFITS OF A NETWORK
• Information sharing: Authorized users can use other
computers on the network to access and share information and data. This
could include special group projects, databases, etc.
• Hardware sharing: One device connected to a network, such
as a printer or scanner, can be shared by many users.
• Software sharing: Instead of purchasing and installing a
software program on each computer, it can be installed on the server. All of
the users can then access the program from a single location.
• Collaborative environment: Users can work together on
group projects by combining the power and capabilities of diverse
equipment.
Ambrose, Bergerud, Busche, Morrison, and Wells-Pusins: IC3 BASICS, Thomson Course Technology, 2003
RISKS OF NETWORK COMPUTING
• The security of a computer network is
challenged everyday by:
▫ Equipment malfunctions
▫ System failures
Note: equipment malfunctions and system failures may be
caused by natural disasters such as floods, storms, or fires, and
electrical disturbances
▫ Computer hackers
▫ Virus attacks
Ambrose, Bergerud, Busche, Morrison, and Wells-Pusins: IC3 BASICS, Thomson Course Technology, 2003
COMMUNICATIONS MEDIA
• Communications Channel
Ambrose, Bergerud, Busche, Morrison, and Wells-Pusins: IC3 BASICS, Thomson Course Technology, 2003
NETWORK/COMMUNICATIONS
PROTOCOLS
• "Gateway" is a term that was once used to refer to a routing device. Today,
in the TCP/IP world, the term "router" is used to describe such a device.
http://en.wikipedia.org/wiki/Image:BNC_connector.jpg http://en.wikipedia.org/wiki/Image:Ethernet_RJ45_connector_p1160054.jpg
Switch/Router
• To connect multiple segments of networks into a
larger one
• Switch
▫ Like hub but with intelligent
▫ Better performance
• Router
▫ Forward packets from one LAN to another
TCP/IP
• A family of protocols that makes the Internet
works
• The Robustness Principle
▫ “Be liberal in what you accept, and conservative in
what you send” - Jon Postel
TCP/IP Network Model
• Different view – 4 layers
▫ Layer 1 : Link (we did not look at details)
▫ Layer 2 : Network
▫ Layer 3 : Transport
▫ Layer 4 : Application
OSI: Open Systems Interconnect
6th
Presentation Layer Application Layer
5th
Session Layer
4th
Transport Layer
Transport Layer
3rd
Network Layer
Network Layer
2nd
Link Layer
Link Layer
1st
Physical Layer
The
Internet
VPN (Virtual Private Network)
• A secure tunnel to a private network through a
public network
• Once established, local node appears to be a
node in the private network in a secure manner
Host & IP Address
“A host is a computer connected directly to the
Internet”
“Your home computer is not a host”
• Each host needs a globally unique IP address
• IPv4 address
▫ A 32-bit number, arranged in 4 numbers
separated by “.”
▫ Eg. 74.125.19.147
TCP/IP protocol family
• IP : Internet Protocol
▫ UDP : User Datagram Protocol
RTP, traceroute
▫ TCP : Transmission Control Protocol
HTTP, FTP, ssh
What is an internet?
• A set of interconnected networks
• The Internet is the most famous example
64 to 1500 Bytes
IP
• Responsible for end to end transmission
• Sends data in individual packets
• Maximum size of packet is determined by the
networks
▫ Fragmented if too large
• Unreliable
▫ Packets might be lost, corrupted, duplicated,
delivered out of order
IP addresses
• 4 bytes
▫ e.g. 163.1.125.98
▫ Each device normally gets one (or more)
▫ In theory there are about 4 billion available
• But…
Routing
• How does a device know where to send a
packet?
▫ All devices need to know what IP addresses are
on directly attached networks
▫ If the destination is on a local network, send it
directly there
Routing (cont)
• If the destination address isn’t local
▫ Most non-router devices just send everything to a
single local router
▫ Routers need to know which network corresponds
to each possible IP address
Allocation of addresses
• Controlled centrally by ICANN
▫ Fairly strict rules on further delegation to avoid
wastage
Have to demonstrate actual need for them
• Organizations that got in early have bigger
allocations than they really need
IP packets
• Source and destination addresses
• Protocol number
▫ 1 = ICMP, 6 = TCP, 17 = UDP
• Various options
▫ e.g. to control fragmentation
• Time to live (TTL)
▫ Prevent routing loops
IP Datagram
0 4 8 16 19 24 31
Vers Len TOS Total Length
Identification Flags Fragment Offset
TTL Protocol Header Checksum
Source Internet Address
Destination Internet Address
Options... Padding
Data...
• Routing Table
Destination IP address
IP address of a next-hop router
Flags
Network interface specification
UDP
• Thin layer on top of IP
• Adds packet length + checksum
▫ Guard against corrupted packets
• Also source and destination ports
▫ Ports are used to associate a packet with a
specific application at each end
• Still unreliable:
▫ Duplication, loss, out-of-orderness possible
UDP datagram
0 16 31
Source Port Destination Port
Length Checksum
Application data
Field Purpose
Source Port 16-bit port number identifying originating application
Destination Port 16-bit port number identifying destination application
Length Length of UDP datagram (UDP header + data)
Checksum Checksum of IP pseudo header, UDP header, and data
Typical applications of UDP
▫ Where packet loss etc is better handled by the
application than the network stack
▫ Where the overhead of setting up a connection
isn’t wanted
• VOIP
• Most games
TCP
• Reliable, full-duplex, connection-oriented,
stream delivery
▫ Interface presented to the application doesn’t
require data in individual packets
▫ Data is guaranteed to arrive, and in the correct
order without duplications
Or the connection will be dropped
▫ Imposes significant overheads
Applications of TCP
• Most things!
▫ HTTP, FTP, …
Send Packet 1
Start Timer Packet Lost Packet should arrive
Timer ACK should be sent
ACK would normally
Arrive at this time
Time Expires
Retransmit Packet1
Timer Start Timer Receive Packet 1
Send AXK 1
Receive ACK 1
Cancel Timer
IPv6
• 128 bit addresses
▫ Make it feasible to be very wasteful with address
allocations
• Lots of other new features
▫ Built-in autoconfiguration, security options, …