Introduction to the TCP IP protocol stack through a role playing game

Introduction to the TCP IP
protocol stack through a role
playing game
Based on : Norman Pendegraft. 2003. The TCP/IP game. In Current
issues in IT education, Tanya McGill (Ed.). IGI Publishing, Hershey, PA,
USA 117-124
Acknowledgment: Many thanks to Ozden Nyiaz for assisting in the preparation of these slides
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Players are organized into four-person teams
that represent different computers in the network.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
NETWORK MAP
Δρ. Χαράλαμπος Ζ. Πατρικάκης
NETWORK MAP
1.1.1.1
11-11
2.2.2.2
22-22
3.3.3.3
33-33
4.4.4.4
44-44
5.5.5.5
55-55
6.6.6.6
66-66
7.7.7.7
77-77
8.8.8.8
88-88
9.9.9.9
99-99
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Each person in the team assumes the role of one layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Outgoing Messages
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Creates messages
Breaks the message into several smaller
messages if necessary
Addresses and routes the message
Formats the message and performs error
control
Transmits the message to the physical
layer of the destination computer
Δρ. Χαράλαμπος Ζ. Πατρικάκης
SMTP
APPLICATION LAYER
From To
_
ID of your
computer
Message
Message (Continued)
_
ID of
destination
computer
Type any message you wish to send up
to 20 characters. Use a hyphen (-) to
indicate spaces between words
• Write the message and the name of the computer to which you send the
message on the blank piece of paper. This will help you understand the
responses you get to your messages.
• Pass the message to the transport layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
TRANSPORT LAYER
SMTP
Break the SMTP message into smaller packets.
Cut the SMTP packet into two parts at the dotted line.
From To
_
Message
Message (Continued)
_
Δρ. Χαράλαμπος Ζ. Πατρικάκης
TC P
Find one or two blank TCP packets.
Sequence User Data
Number
If there is only one part of the SMTP
packet, write "1 of 1" in the
Sequence Number box.
SMTP
_ of _
From
To
Message
Message (Continued)
If it’s blank
Δρ. Χαράλαμπος Ζ. Πατρικάκης
TC P
Sequence User Data
Number
TC P
If there are two parts of the SMTP
packet, write "1 of 2" on the first
TCP packet.
SMTP
_ of _
From
To
Message
Sequence User Data
Number
_ of _
Message (Continued)
"2 of 2" on the second TCP packet.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Tape the SMTP packet(s) to the TCP packet(s) over the User Data space.
_ of _
SMTP
TC P
Sequence User Data
Number
From To
Message
Pass the message to the network layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
NETWORK LAYER
Find a blank IP packet.
Next Node
_._._._
_._._._
User Data
To
Message
Put the IP address of the
PC corresponding to the
PC of the To box of the
SMTP packet
Next computer’s
IP address in the
network map
Sequence Number User Data
SMTP
From
TC P
SMTP
IP
Final Destination
From
To
Message
Δρ. Χαράλαμπος Ζ. Πατρικάκης
If your computer is directly connected to the
final destination computer, the “Next Node”
is the same as the final destination.
Your
Computer
Final
Destination
Δρ. Χαράλαμπος Ζ. Πατρικάκης
If your computer is not directly connected to the destination,
you must select the best route that the message should follow
and specify one of the computers to which you are connected.
Your
Computer
Final
Destination
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Tape the TCP + SMTP packet to the IP packet over the User Data space.
Next Node User Data
TC P
IP
Sequence
Number
_._._._ _._._._
_ of _
User Data
SMTP
Final
Destination
From
_
To
_
Message
Pass the message to the data link layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Source
_ _:_ _
Destination
Control Message# Error
_ _:_ _
_
User Data
_
*
Your computer’s
MAC address
Number of
hyphens
1st message 01
2nd message 02
Put the MAC address of
the PC corresponding to
the PC of the Next
Node box of the IP
packet.
Next Node
User Data
TC P
IP
Final Destination
_._._._
_ ._._._
Sequence
Number
_ of _
User Data
SMTP
Ethernet
DATA LINK LAYER
From
To
_
_
Message
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Destination
Control
Message#
Error
User Data
Final
Destination
Next
Node
User Data
_ _:_ _
_ _:_ _
_
_
TC P
IP
Ethernet
Sequence
Number
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Source
From
_
To
Message
_
Tape the SMTP + TCP + IP packet to the
Ethernet packet over the User Data space.
Pass the message to the physical layer. In a few moments, the physical layer will return
the packet to you.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
PHYSICAL LAYER
Data Messages
_ _:_ _
Error
User Data
Final
Destination
Next
Node
User Data
Sequence
Number
TC P
*
Message#
_
_
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
_ _:_ _
Control
IP
Destination
Ethernet
Source
From
_
To
Message
_
• If the Control box contains an asterisk (*) this is a data message.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
 Before transmitting the message. Determine if there will be an
error in transmission by tossing two coins; if they are both
heads, you will introduce an error. Change the number in the
error box to your new calculation.
 Alternative version: You will transmit a message by giving it to
the supervisor of the lab/course. He/she may decide to
introduce an error (you will not know about it)
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Ethernet
IP
TC P
SMTP
Take a picture of the original packets via your mobile phone.
Save the picture for next steps.
From
To
Message
Sequence Number
Final Destination
Source
Destination
_ _:_ _
_ _:_ _
User Data
Next Node
Control
User Data
Message# Error
_
User Data
_
Δρ. Χαράλαμπος Ζ. Πατρικάκης
ORIGINAL PACKET
Destination
Control
Message#
Error
User Data
Final
Destination
Next
Node
User Data
_ _:_ _
_ _:_ _
_
_
TC P
IP
Ethernet
Sequence
Number
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Source
From
_
To
Message
_
Pass the original SMTP + TCP + IP + Ethernet packet back to the data link layer and make
sure that that person understands that you are giving back the message that he/she just
gave you to transmit.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Control Messages
Destination
Control
Message#
Error
User Data
Ethernet
Final
Destination
_ _:_ _
_ _:_ _
User Data
Sequence
Number
TC P
IP
ACK
or
NAK
Next
Node
_
_
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Source
From
_
To
Message
_
• If the Control box contains an ACK or an NAK, this is a control message.
• Simply pass the Ethernet packet to the physical layer of the computer whose
address is listed in the Destination box. Things are complicated enough without
ACKs and NAKs getting destroyed.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Incoming Messages
Δρ. Χαράλαμπος Ζ. Πατρικάκης
DATA LINK LAYER
Destination
Control
Message#
Error
User Data
Next
Node
User Data
Sequence
Number
_ _:_ _
_ _:_ _
_
_
_ ._. _ ._
_ ._. _ ._
TC P
IP
Ethernet
*
Final
Destination
_ of _
User Data
SMTP
Source
From
_
To
Message
_
If the Control box contains an asterisk (*), this is a data message. Perform error
checking. Count the number of hyphens in the user data (the SMTP packet, the
TCP packet, and the IP packet [but not the Ethernet packet]). If this number is
the same as the number in the Error box, no errors have occurred. If they are
different, an error has occurred.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
If no errors have occurred in data message
Ethernet
Find a blank Ethernet packet.
Source
__:__
Your MAC
address
Destination
Control Message# Error
__:__
_
ACK
Write the Ethernet
address contained in
the Source box of the
incoming message
User Data
_
Write the two-digit
number contained in
the Message Number
box of the incoming
message in the Message
Number box
Pass the outgoing ACK message to the physical layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Remove the Ethernet packet from the incoming message, and throw
the Ethernet packet away.
Control
Message#
Next
Node
User Data
Sequence
Number
IP
Ethernet
_ _:_ _
User Data
Final
Destination
*
_ _:_ _
Error
_
_
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Destination
TC P
Source
From
_
To
Message
_
Pass the incoming SMTP + TCP + IP packet to the network layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
If an error has occurred in data message
Ethernet
Find a blank Ethernet packet.
Source
__:__
Your MAC
address
Destination
Control Message# Error User Data
__:__
_
NAK
Write the Ethernet
address contained in
the Source box of the
incoming message
_
Write the two-digit
number contained in
the Message Number
box of the incoming
message in the Message
Number box
Pass the outgoing NAK message to the physical layer.
Throw away the incoming message containing the error.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
If the Control box contains an ACK, this is an ACK
message.
Destination
_ _:_ _
_ _:_ _
Ethernet
Source
Control
ACK
Message#
_
Error
User Data
_
Find the original message you sent, from the photo that you have taken for next steps, that has
the same message number as the ACK.
Destroy the original message and the ACK.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
If the Control box contains an NAK, this is an NAK message.
Control
Message#
Error
User Data
Ethernet
Final
Destination
_ _:_ _
_ _:_ _
User Data
Sequence
Number
IP
NAK
Next
Node
_
_
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Destination
TC P
Source
From
_
To
Message
_
Find the original message you sent, from the photo that you have taken for next steps, that has
the same message number as the NAK.
Give the original message to the physical layer to transmit again. In a few moments, the physical
layer will return the packet to you.
Destroy the NAK.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
NETWORK LAYER
 If the message is addressed to you
Next
Node
User Data
TC P
IP
Sequence
Number
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Final
Destination
From
_
To
Message
_
If it’s your IP address
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Remove the IP packet from the SMTP + TCP
packet and throw the IP packet away
Next
Node
User Data
TC P
IP
Sequence
Number
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Final
Destination
From
_
To
Message
_
Pass the SMTP + TCP packet to the transport layer
Δρ. Χαράλαμπος Ζ. Πατρικάκης
 If the message is not addressed to you
Next
Node
User Data
TC P
IP
Sequence
Number
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Final
Destination
From
_
To
Message
_
If it’s someone else’s IP address
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Next
Node
User Data
TC P
IP
Sequence
Number
_ ._. _ ._
_ ._. _ ._
_ of _
User Data
SMTP
Final
Destination
From
_
To
Message
_
Scratch out or erase the address in the Next Node
box. Route the message by finding the next
computer in the network map to which the message
should be sent and writing its data link layer address
in the Next Node box.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Remove the IP packet from the SMTP + TCP
packet and throw the IP packet away
Next
Node
User Data
Sequence
Number
IP
Old IP
_ ._. _ ._
_ ._. _ ._
TC P
New IP
_ of _
User Data
SMTP
Final
Destination
From
_
To
Message
_
Substitute the IP part with the new one
Pass the message to the transport layer.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Sequence User Data
Number
_ of _
SMTP
TC P
TRANSPORT LAYER
From
To
_
_
Message
If the Sequence Number box says "1 of 1":
The message is completed.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Sequence User Data
Number
_ of _
SMTP
TC P
Take the TCP packet off of the SMTP packet
and throw away the TCP packet
From
To
_
_
Message
Pass the SMTP packet to the application layer
Δρ. Χαράλαμπος Ζ. Πατρικάκης
_ of _
User Data
SMTP
TC P
Sequence
Number
From
To
_
_
Message
TC P
If the Sequence Number box says "1 of 2":
The message is not completed.
Sequence
Number
User Data
Message (Continued)
_ of _
Wait for the second part of the message (2 of 2) to arrive.
Δρ. Χαράλαμπος Ζ. Πατρικάκης
Sequence User Data
Number
TC P
_ of _
SMTP
TC P
Take the TCP packets off of both
SMTP packets and throw away the TCP packets
From
To
_
_
Message
Sequence User Data
Number
Message (Continued)
_ of _
Δρ. Χαράλαμπος Ζ. Πατρικάκης
SMTP
Tape the two parts of the SMTP packet back together.
From To
_
Message
Message (Continued)
_
Δρ. Χαράλαμπος Ζ. Πατρικάκης
SMTP
From To
_
Message
Message (Continued)
_
Pass the SMTP packet to the application layer
Δρ. Χαράλαμπος Ζ. Πατρικάκης
APPLICATION LAYER
Eventually, you will receive an incoming message
from the transport layer that was sent to you by
some other computer asking you a question.
To respond to the message, you will send a message
that answers the question.
Follow the same steps above to send a message
write your answer in the Message box.
For example, if the message you received asked what
your favorite color was, you might write red or blue
in the Message box.
Δρ. Χαράλαμπος Ζ. Πατρικάκης