Ghidul Viitorului Student Al Faculltății de Automatică Și Calculatoare
Ghidul Viitorului Student Al Faculltății de Automatică Și Calculatoare
Ghidul Viitorului Student Al Faculltății de Automatică Și Calculatoare
Networkprogramming
Dipl.-Ing. Olaf Fischer
Dipl.-Ing. Udo Willers
course contents I
• 1.11
E2 (wireshark traceing)
• 8.11
E3 (SNMP, tkined)
• 15.11
Encryption, cryptool, GPG (E5)
• 22.11
Firewall (Linux firewall iptables)
• 29.11
UNIX C Programming (E6)
• 6.12
Socket programming (E7+E8)
• 20.12
Completion of E7/E8
Kolloquium
star topology
(structured
cabling)
Active components
Hub Switch Router
sender receiver
ether
free,sender
starts transm.
and monitors
own transm.
sender receiver
frame is
receicesd
without
collision
collision
sender I sender II receiver
Sender I+II
monitors the
ether
•6-Byte MAC-Address
•Frametype defines encapsulated protocol
•data-field with 0-1500 Bytes (eventually with
padding)
MAC-address
Example: 00:20:30:F1:13:03
vendor serial
•worldwide unique
•each vendor has its own vendor-code and
controls its own serials
GW Provider C
Provider B
G
W net 3
net 2 72.0.0.0
Host B
139.13.17.200
Provider A
Netz1
Host A 139.13.0.0
Internet address
ARP Reply
139.13.17.140 is
00:20:31:A0:20:01
class networks
>>> CIDR
hosts mask range
A 128 16.777.214 255.0.0.0 0.0.0.0-127.255.255.255
B 16.384 65.535 255.255.0.0 128.0.0.0-191.255.255.255
C 2.097.152 256 255.255.255.0 192.0.0.0-223.255.255.255
CIDR
• classless adresses
• each address hast an associated mask as its suffix
• Example: 192.168.2.7/24 => 255.255.255.0
• many former class-A and B-nets are allocated to
smaller networks
special IP-addresses
address range description RFC
0.0.0.0/8 current network 3232
10.0.0.0/8 private network 1918
14.0.0.0/8 public data net 3232
39.0.0.0/8 reserved 1797
127.0.0.0/8 localnet 3330
128.0.0.0/16 reserved
169.254.0.0/16 zeroconf 3927
172.16.0.0/12 private network 1918
191.255.0.0/16 reserved by IANA
192.0.0.0/24 reserved by IANA
192.0.2.0/24 documentation and examples 3330
192.88.99.0/24 6to4-anycast-prefix 3068
192.168.0.0/16 private network 1918
198.18.0.0/15 benchmark network 2544
223.255.255.0/24 reserved 3330
224.0.0.0/4 multicasts 3171
240.0.0.0/4 reserved 3232
255.255.255.255 broadcast
network address
• the IP-address bitwise-AND-conjuncted
with the network mask results in the
networks address
• IP-address bitwise-OR-conjuncted with
the inverted network mask results in the
broadcast address
139. 13. 17.135/20
139. 13. 17.135/20
AND 255.255.240. 0 OR 0. 0. 15. 255
= 139. 13. 16. 0 = 139. 13. 31.255
Netzwerkadresse Broadcastadresse
Internet routing
local net -> direct routing
FH-WHV-I
139.13.16.0
139.13.17.135 139.13.17.141
139.13.26.233 139.13.44.124
139.13.17.240 139.13.44.35
bitwise AND
destination IP with
own netmask
ARP
own net? (translation IP to
MAC)
host
Routing
in deliver frame to
Routing- resulting MAC
table?
algorithm
send to next
hop
net in
Routing-
table?
send to next
hop
Default
Route
in table?
to default-
router
routing error
example
summary of routing
• direct/indirect routing by means of the
network address
• indirect routing by means of a routing table
• next-hop-delivery (only directly reachable
routers in the routing table)
Header SOURCE IP
DESTINATION IP
data
DATA
IP-datagramm transport
via ethernet
Eth-Header Eth-Data
D-Mac S-Mac 0800 IP-Header IP-Data CS
Internet Control Message
Protocoll (ICMP)
ICMP-Header ICMP-Data
IP-Header IP-Data
Frame-Header Frame-Data CS
„Encapsulation“
layer models
layer ISO/OSI TCP/IP protocol examples
7 application
telnet, ssh,ftp,
Applikations
6 presentation http,imap,nfs,
Protokolle pop,smtp
communication
5 control
Transport
4 transport Protokolle TCP,UDP
Internetwork
3 internetwork Protokolle IP,ICP,ARP,RARP
2 data link Network Ethernet,
Access 802.11g,
1 physical Protokolle
Token Ring
layers and data units
application message application
LAN
example „Router“
data link / physical Frame data link / physical Frame data link / physical
LAN LAN
transport protocol UDP
0
16
31
SOURCE PORT DESTINATION PORT
LENGTH CHECKSUM
DATA
port-mechanism
139.13.17.200 139.13.17.144
Port: 16200 Port: 123
37 time time
Sequence Number
Acknowledge Number
Daten DATA
transmission
send 1 send 1 send 1
lost
send 2
rcv 1 rcv 1
send 3
ack 1 ack 1
rcv 1
timer ack 1
rcv ack 1 expired rcv ack 1 rcv 1
rcv ack 2 ack 1
retransmit 1
send 2 rcv ack 3
rcv 1
1. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
window Seq.No=4
3. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
FIN
ACK SEQ=y+1
SEQ=1, ACK=1
ACK
SEQ=y+2
Opera TCP-Conn. 1
http-Server
Firefox TCP-Conn. 2
139.13.17.200 139.13.17.144
Port: 16205 Port: 80