What is TCP/IP? - Dept. of IE, CUHK Personal Web Server

Download Report

Transcript What is TCP/IP? - Dept. of IE, CUHK Personal Web Server

Objectives
• A basic understanding of the following
– What is Internet?
– What is client-server computing?
– What is LAN? What is Ethernet?
– What is Internet protocol?
– How to write your web page?
– What is broadband network?
– What is MPEG1, MPEG2, and MP3?
– What is e-commerce?
Department of Information Engineering
1
Internet
• Internet
– What is LAN?
– What is Internet?
– What is TCP/IP?
– What is domain name?
– Application - how does email work?
Department of Information Engineering
2
What is Local Area Network (LAN)?
• Problem
– What is the simplest way to connect the
following computers together?
Department of Information Engineering
3
What is Local Area Network (LAN)?
• Mesh
– too many links !
• Bus
– single cable
linking all
computers
Department of Information Engineering
4
LAN
• Network address
– to send data to a destination, we need an
address
– each computer is connected to the LAN by a
network card
– each card has a unique network address
• the data we sent has two parts
– header: contains the source and destination
address (like an envelop)
– body:
contains the information (like a
letter)
• together, it is called a packet
Department of Information Engineering
5
Contention problem
• only one computer can
use the cable at a time
• e.g. a -> c
c
b
d
a
• if more than one
computer uses the
cable to send data,
collision !
• e.g. a -> c, b -> d
e
c
b
d
a
Department of Information Engineering
e
6
Contention problem
• Contention problem
– How to solve the problem that more than one
computer want to transmit at the same time
• classic problem in network
– many solutions
– example
• polling
• divide into time slots (time division)
• divide into frequency slots (frequency
division)
• CDMA (most complex)
• ALOHA-based (Ethernet, GSM)
Department of Information Engineering
7
ALOHA-based protocol
• A classroom game
– imagine you are in a classroom and you want
to raise a question
• Rules
– you must close your eyes
– only one student can speak at a time
– if more than one student speak, the teacher
cannot hear the question
• Question
– how to raise questions in an orderly fashion
without any coordinator?
Department of Information Engineering
8
ALOHA-based protocol
• solution:
– you listen before you raise question !!
– if someone is speaking, do not raise question!!
– thereby avoid collision
– the first person who raises the question speak
first
– in our computer LAN, the first computer who
sends data get the channel
• the computer then sends the destination
address of the receiving computer, followed
by the data
Department of Information Engineering
9
ALOHA-based protocol
• But what if two students raise question at the
same time?
• Solution
– each student rolls a dice and wait for a random
period of time
– if student A gets a 1, and student B gets a 3,
then the student A will wait for 1 second, and B
will wait for 3 seconds
– after one second, A will speak out first
– after three seconds, B will try to speak out, but
B will listen first; if A is still talking, B will wait
until A has finished
Department of Information Engineering
10
ALOHA-based protocol
• In computer network, this means each computer
listens to the cable, if the cable is idle (no signal),
sends immediately; otherwise, waits
• if more than one computer send data
simultaneously, we have a collision
• in this case, each computer will wait for a random
period of time, the one who sends first will grab
the channel
Department of Information Engineering
11
Ethernet
• This type of networking protocol has been in use
for nearly thirty years !!
• It is called Ethernet and currently over 90% of the
LANs in used today are based on it
• however, with the abundance
of processing power, the
topology of Ethernet has
changed from a shared bus
to a star topology
S
• communication is via a switch
Department of Information Engineering
12
GSM
• It is also the principle used in mobile network like
GSM
– each mobile phone transmits signal using a
frequency slot
– but the number of frequency slots is limited,
so it is possible that two mobile phones may
compete for the same frequency slot at the
same time
– if there is a collision, each mobile phone will
wait for a random period of time, the one who
wakes up first will get the frequency slot
Department of Information Engineering
13
What is Internet?
• Problem of interconnecting LAN
– by late 70, many different types of LAN existed
– What is the problem in connecting the LANs?
Network 1
Network A
c
3
d
b
a
e
Department of Information Engineering
4
2
1
5
14
What is Internet?
• Addressing problem
– to send data to a destination, you need an
address
– different technology uses different naming
convention for the address
– LANs cannot communicate with each other
• needs a standard way to address computers
Department of Information Engineering
15
IP address
• IP address
– the universal address is called IP address
– IP stands for Internet Protocol
– it is a 12-digit number (e.g. 137.189.123.108)
• we therefore have two set of addresses
– physical address
• address used by the LAN
• must use this address for delivery
– Internet address
• just a unique number
Department of Information Engineering
16
Post office scenario
• Limitation of a LAN
– LAN can deliver address that is supported by
its own LAN technology
– the physical address
• e.g. the Ethernet address in the card
– cannot send address to another LAN that is
other kind of technology (e.g. token ring)
– need a middleman to forward the packet
– router
Department of Information Engineering
17
Data
Data
IP address
147.189.123.108
d
a
147.189.123.108
147.189.123.108
1
d
2
d
1
1
router
147.189.123.108
Department of Information Engineering
18
What is Internet?
• Internet communicates in exactly the same way as
our postal service
• the packet we sent (data + IP address) is called
datagram
– (as we sometimes call air mail letters as
aerogramme)
Department of Information Engineering
19
What is Internet?
• Problem with datagram (and letters)
– like letters, if we send a sequence of datagrams,
the following may happen
• the datagram is lost, needs to re-send again
• the datagram is not lost, we have to eliminate
the duplicate packet
• the datagrams arrived out of sequence
Department of Information Engineering
20
What is TCP (Transmission control protocol) ?
• Use of TCP
– IP only deals with the addressing problem,
cannot deal with error
• such as lost, duplicate, and out-of-sequence
datagram
– to deal with error, we need to add a sequence
number to each of the datagram we sent, and
check whether the sequence is correctly received
at the other side
– the software to do this is called TCP
– TCP is used to provide reliable communication
on Internet
Department of Information Engineering
21
Data
012234
147.189.123.108
d
a
TCP
sequence number checked
IP
1
2
d
012234
147.189.123.108
147.189.123.108
d
Data
1
1
router
147.189.123.108
Department of Information Engineering
22
Summary
• communication on Internet is based on TCP/IP
• it is operates in exactly the same way as our
postal service
• this is really all you need to know about TCP/IP
Department of Information Engineering
23
What is domain name?
• Is 147.189.123.108 easy to remember?
• NO !!
– A 12 digits long telephone number is hard for
everyone to remember
• Solution?
– remember a name, not a number
– let the directory on Internet (DNS) translate
the computer name to IP number for you,
transparently
Department of Information Engineering
24
What is domain name?
3. Datagram to 147.189.123.08
Your computer
147.189.123.108.
2. 147.189.123.109
1. www.xyz.com?
Internet Directory (DNS)
www.xyz.com 147.189.123.109
www.zzz.com 147.190.231.68
...
Department of Information Engineering
...
25
Application
• Email
• Example:
mchang @ ie.cuhk.edu.hk
Name of my mail box
Department of Information Engineering
Name of the computer that
collects mails to my dept
26