Title: Internet?????????
1?8?(?) ???
- ????
- ??????????
- ??/??
- ??????
- ????
- ????
- Internet?????????
- ?????
- ?8?
- ????
- ??????
- ??/??
- ?????? UDP
- ????????
- ??????? TCP
- ????
- ????
- ????
- TCP????
2???????
- ??????????????????
- ????????????
- ?? vs. ?????
- ??? ?????????
- ??? ????????
- ???, ???, ??????
3?????
- Internet ????
- ??, ??????? (TCP)
- ????
- ????
- ????
- ???? (????), ??????????? UDP
- ???????
- ???
- ????
- ???????
4??/??(multiplexing/Demultiplexing)
- ?? segment (?)- ?????????????
- TPDU ???????
?? ?????????????????
receiver
P3
P4
application-layer data
segment header
P1
P2
segment
H
t
M
segment
5??/??
???????????, ???(???????)????
32 bits
???
???
??????
- ??/??
- ?????, ???????, IP ??
- ?, ???? s ???????
- ?? ????????????(well-known port number)
????? (??)
TCP/UDP ???
6??/?? ??
Web??? ?? C
??? B
?? A
????? ??? telnet ??
Web ??? B
Web??? ?? A
????? Web ???
7UDP ??????? RFC 768
- ???? Internet ????
- ????? ??, UDP ?????
- ??
- ?????????
- ???
- ?UDP??????, ??????
- ?? UDP ???????????
- ????? UDP?
- ?????? (?????)
- ?? ?????????????
- ????
- ????? UDP ????????
8UDP (?)
- ??????????
- ??????
- ???????
- ?? UDP?? (why?)
- DNS
- SNMP
- ????? UDP?????????????????
- ??????-?????????!
32 bits
???
???
??, UDP ?????, ????
checksum
length
????? (??)
UDP ?????
9UDP ???(checksum)
?? ????????? (e.g., ??)
- ???
- ???????????????
- ?????????????????
- NO ????
- YES ?????. ???????????
- ???
- ?????????16???
- checksum ???????(???)
- ????????? UDP checksum ??
10????????
- ???????????????
- ???????top-10 ????!
- ???????????????????(rdt)????
11?????? ????
???
???
12?????? ????
- ????
- ????????????????? (rdt)
- ??????????
- ??????????!
- ??????? (FSM) ??????, ???
?? ??????????, ??????????????
?????????
???????????
13Rdt1.0 ???????????????
- ??????????
- ??????
- ??????
- ???????????? FSMs
- ??????????????
- ??????????????
14Rdt2.0 ?????????????
- ???????????????????
- ?? UDP checksum ?????
- ?? ????????
- ???? (ACKs) ????????????????
- ???? (NAKs)????????????????,??????
- ??????NAK???????
- ??????????? ACKs, NAKs?
- rdt2.0???? (? rdt1.0????)
- ????
- ?????? ???? (ACK,NAK) rcvr-gtsender
15rdt2.0 ???????
????FSM
???FSM
16rdt2.0 ???? (?????)
??? FSM
??? FSM
17rdt2.0???? (????)
??? FSM
???FSM
18rdt2.0 ????????!
- ?ACK/NAK ?????
- ????????????????!
- ?????? ????????
- ????
- ?? ACK/NAK ??????? ACK/NAK? ???????? ACK/NAK ???
- ??, ???????????????!
- ???????
- ??????????sequence number (??)
- ??ACK/NAK??,???????????
- ?????????? (?????)
?????????,??????????
19rdt2.1 ???, ????? ACK/NAK
20rdt2.1 ???, ????? ACK/NAK
21rdt2.1 ??
- ???
- ????seq
- ?? s (0,1) ??,????
- ????ACK/NAK
- ?????
- ?? ?? ??,?? ??????? 0 ? 1 seq.
- ???
- ?????????? ????
- ??????0 ? 1 ????? seq
- ?? ??????????ACK/NAK ??????????
22rdt2.2 ? NAK???
??? FSM
- ????? rdt2.1, ???? ACK
- ??? NAK, ???????????????? ACK
- ?????????ACK ??? seq
- ???????ACK?? NAK????? ???????
!
23rdt3.0 ????????????
- ???? ??????????? (??? ACK)
- checksum, seq. , ACK, ????????,??????
- Q ?????????
- ???????,??????ACK ???, ????
- ??? ???
- ?? ?????ACK?? ??? ??
- ?????????????????
- ????(? ACK)?????? (????)
- ???????, ???seq. s ????
- ???????? ACK??? seq
- ???????
24rdt3.0 ???
25rdt3.0 ???
26rdt3.0 ???
27rdt3.0???
- rdt3.0 ??, ??????
- ?? 1 Gb/s ??, 15 ms ??????, 1KB ??
- 1KB ??? 30 ms -gt 33kB/sec ? 1 Gb/s ???????
- ??????????????!
28?????
- ???? ????????????????
- ??????????
- ???????????
- ?????????? ?N?????(go-Back-N), ????
29??N?????(Go-Back-N)
- ???
- ???????k? seq
- ?????N?????, ?????????????
- ACK(n) ACK??n???,??n??????-- ???ACK
- ???????ACK (????)
- ??????(in-flight)????????(timer)
- ?????timeout(n) ??n??n????????
30GBN ?????? FSM
????
????
ACK???
31GBN ?????? FSM
- ?????
- ACK-only ??????????????( in-order )??? seq
??ACK - ???????ACKs
- ?????? expectedseqnum(?????)
- ????
- ?? (???) -gt ???????!
- ???????????? seq ??ACK
32GBN ???
33????(SR)
- ???????????????????
- ????,?????(??)??????, ?????????????
- ?????????????????
- ??????unACKed ???????
- ??????
- N ???? seq s
- ???????seq s, unACKed??????
34???? ???, ??????
35????
- ??n??rcvbase, rcvbaseN-1
- ?? ACK(n)
- ?? ??
- ?? ????? (??????????????), ????????????????
- ??n?? rcvbase-N,rcvbase-1
- ?????????,?????ACK(n)
- ???? ????
- ??????
- ?????????????,????
- timeout(n)?n??????
- ????n, ?????
- ACK(n) ??sendbase,sendbaseN
- ???? n ????
- ?n?unACKed???????, ???????????unACKed seq
36???????
37TCP ?? RFCs 793, 1122, 1323, 2018, 2581
- ???????
- ??????????
- MSS maximum segment size(??????-1500,536,512)
- ????
- ???? (??????) ????????????????,????
- ????
- ????????????????????
- ???
- ?????, ?????
- ??, ??????
- ? ????,???????
- ?????
- TCP????????,??????
- ?? ????
38TCP ???
URG urgent data (????)
?????????? (?????!)
ACK ACK valid
PSH push data now (????)
bytes ????????
RST, SYN, FIN connection estab (setup,
teardown commands)
Internet checksum (as in UDP)
39TCP seq. s ? ACKs
- Seq. s
- ??????????(????)???? ??
- ACKs
- seq ?????????????????
- ??? ACK
- Q ?????????????
- A TCP ????, - ????????
Host B
Host A
User types C
Seq42, ACK79, data C
host ACKs receipt of C, echoes back C
Seq79, ACK43, data C
host ACKs receipt of echoed C
Seq43, ACK80
??? telnet ??
40TCP ??????
event data received from application above
??????, ??
create, send segment
wait for event
event timer timeout for segment with seq y
wait for event
retransmit segment
event ACK received, with ACK y
ACK processing
41TCP ??????
00 sendbase initial_sequence number 01
nextseqnum initial_sequence number 02 03
loop (forever) 04 switch(event) 05
event data received from application above 06
create TCP segment with sequence
number nextseqnum 07 start timer for
segment nextseqnum 08 pass segment
to IP 09 nextseqnum nextseqnum
length(data) 10 event timer timeout for
segment with sequence number y 11
retransmit segment with sequence number y 12
compue new timeout interval for segment y
13 restart timer for sequence number
y 14 event ACK received, with ACK field
value of y 15 if (y gt sendbase) /
cumulative ACK of all data up to y / 16
cancel all timers for segments with
sequence numbers lt y 17
sendbase y 18 19
else / a duplicate ACK for already ACKed
segment / 20 increment number
of duplicate ACKs received for y 21
if (number of duplicate ACKS received for y
3) 22 / TCP fast
retransmit / 23 resend
segment with sequence number y 24
restart timer for segment y 25
26 / end of loop forever /
??? TCP ???
42TCP ACK ?? RFC 1122, RFC 2581
TCP ?????? ?? ACK. ?? 500ms ??????????.
????, ??ACK ?????? ??? ACK ????? ACK, ?? seq.
????????? ?? ACK,???????????????
?? ???????, ??????, ????????? ACKed ???????,
??????, ????? ACK ?? ??????? seq.
????? ???? ??????????????????
43TCP ????
Host A
Host B
Seq92, 8 bytes data
Seq100, 20 bytes data
Seq92 timeout
ACK100
ACK120
Seq100 timeout
Seq92, 8 bytes data
ACK120
????, ?? ACKs
44TCP ????
- ??? ??????? (??????) ??????
- RcvWindow TCP ??????
- ??? ????????, unACKed ??????????RcvWindow
??????????????????????????
RcvBuffer ???? TCP ???? RcvWindow ????????
?????
45TCP ???????(RTT)???
- Q ???? RTT?
- SampleRTT ?????????ACK ?????????
- ????, ?? ACKed ???
- SampleRTT ?????, ?????? RTT ???
- ???????????, ?????????? SampleRTT
- Q ???? TCP ?????
- ??RTT???
- ?? RTT ???!
- ??? ??????
- ????????
- ??? ????????????
46TCP RTT ??? (p246)
EstimatedRTT (1-x)EstimatedRTT xSampleRTT
- ????????(EWMA)
- ????????????????
- X????? 0.125?1/8
- ????
- EstimtedRTT ?? ????(safety margin)
- ?? EstimatedRTT???? -gt ??????
Timeout EstimatedRTT 4Deviation
Deviation(??) (1-x)Deviation
xSampleRTT-EstimatedRTT
47TCP ????
- ?? TCP ???????????????????
- ??? TCP??
- seq. s
- ??, ?????? (e.g. RcvWindow)
- ??? ??????
- Socket clientSocket new Socket("hostname","p
ort number") -JAVA - ??? ????????
- Socket connectionSocket welcomeSocket.accept()
- (????)????
- Step 1 ????end system?????? TCP SYN ?????
- ?????? seq
- Step 2 ????end system?? SYN, ?SYNACK???????
- ACKs ???? SYN
- ????
- ?? server-gt receiver ??? seq.
- Step 3????end system??????ACK
- ACKs ????????
- ????
48TCP???????????
??SYN??(SEQx)
??SYN??(SEQx)
??SYN?? (SEQy, ACKx1)
??SYN?? (SEQy, ACKx1)
????(ACKy1)
????(ACKy1)??????
49TCP ???? (?)
- ????
- ??????? clientSocket.close()
- Step 1 ??? end system ?? TCP FIN ???????
- Step 2 ??? ?? FIN, ? ACK??. ????, ?? FIN.
50TCP ???? (?)
- Step 3 ??? ?? FIN, ? ACK????.
- ???????FIN??ACK-???? timed wait(????)
- Step 4 ???, ?? ACK. ????.
- ?? ????,???????????FINs.
client
server
closing
FIN
ACK
closing
FIN
ACK
timed wait
closed
closed
51TCP???????????
????????
???????
?????????
??FIN??(SEQx)
??FIN??(SEQx)
TCP????(ACKx1)?
??ACK??(ACKx1) A?B?????(???) ?A??????
??FIN??? (SEQy, ACKx1)
??FIN??(SEQy)
TCP????(ACKy1)
????(ACKy1) B?A?????
52??????
- ??
- ?????? ???????????????????????????
- ???????!
- ??
- ?????? (???????)
- ?????? (??????????)
- ??????????a top-10 problem!
53TCP ????
- ?????? (??????)
- ??????????????????????Congwin??
Congwin
- w?????, ???? MSS??,??? RTT?????
54TCP ????
- ?? ??
- slow start(???)
- congestion avoidance(????)
- ????
- Congwin
- threshold ?????????,??????????
- ?? ????
- ???? ???? (Congwin ????) ??????
- ?? Congwin ???????? (??)
- ???? ?? Congwin, ??????????(??Congwin)
55TCP Slowstart(???)
Host A
Host B
one segment
RTT
initialize Congwin 1 for (each segment ACKed)
Congwin until (loss event OR
CongWin gt threshold)
two segments
four segments
- ????????? (?? RTT) (????!)
- ???? ??(Tahoe TCP) ?/????? ACKs (Reno TCP)
56TCP ????
????
/ slowstart is over / / Congwin gt
threshold / Until (loss event) every w
segments ACKed Congwin threshold
Congwin/2 Congwin 1 perform slowstart
1
1 ????????ACK?,TCP Reno ??? slowstart (????
) ????,Congwin???????,????,?????
57??? ??
- ???????
- ??/??
- ??????
- ????
- ????
- ????????????
- UDP
- TCP
- ???
- ??????? (??/ ???)
- ????? ??