Your SlideShare is downloading. ×
Plan 9カーネルにおけるTCP/IP実装(未完)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Plan 9カーネルにおけるTCP/IP実装(未完)

1,837
views

Published on

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,837
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Plan 9 TCP/IP oraccha Plan9 http://d.hatena.ne.jp/oraccha/ 2010 3 31
  • 2. /net • net ether0 tcp udp cs dns 0 1 clone stats ctl data err listen local remote status
  • 3. • • NW /net bind % ns : bind -a '#l' /net /net/ether bind -a '#I' /net IP /net/ipifc,arp,icmp,udp,tcp,...
  • 4. write(2) read(2) ip/devip.c ipwrite ipread wq rq tcpkick ip/tcp.c tcpiput tcpoutput ip/ip.c ipoput4 ipiput4 ip/ethermedium.c etherbwrite etherread4 etherbwrite pc/devether.c etheroq in oq etheriq pc/etherxxxx.c transmit interrupt
  • 5. Queue Block • struct Queue: • • Block • struct Block: • BSD mbuf Linux sk_buff • Block 64KB
  • 6. write (port/sysfile.c) • fdtochan fd Chan *c • devtab[c->type]->write Proc Fgrp Chan Dev devtab[] ‘l’ “IP” *fgrp **fd type &etherdevtab &ipdevtab (*write)() devtab[]
  • 7. Dev ipdevtab = { 'I', /* dc */ "ip", /* name */ ipreset, /* reset */ devinit, /* init [Do nothing] */ devshutdown, /* shutdown [Do nothing] */ ipattach, /* attach */ ipwalk, /* walk */ ipstat, /* stat */ ipopen, /* open */ ipcreate, /* create [Eperm] */ ipclose, /* close */ ipread, /* read */ ipbread, /* block read */ ipwrite, /* write */ ipbwrite, /* block write */ ipremove, /* remove [Eperm] */ ipwstat, /* wstat */ };
  • 8. • namec ipattach • Fs ipprotoinit[] e.g. tcpinit Fs *ipfs[Nfs] Fs Proto dev dev “tcp” *p[] IP_TCPPROTO IP_TCPPROTO *t2p[] *f ipprotoinit[]
  • 9. void tcpinit(Fs *fs) { Proto *tcp; Tcppriv *tpriv; tcp = smalloc(sizeof(Proto)); tpriv = tcp->priv = smalloc(sizeof(Tcppriv)); tcp->name = "tcp"; tcp->connect = tcpconnect; tcp->announce = tcpannounce; tcp->ctl = tcpctl; tcp->state = tcpstate; tcp->create = tcpcreate; tcp->close = tcpclose; tcp->rcv = tcpiput; tcp->advise = tcpadvise; tcp->stats = tcpstats; tcp->inuse = tcpinuse; tcp->gc = tcpgc; tcp->ipproto = IP_TCPPROTO; tcp->nc = scalednconv(); tcp->ptclsize = sizeof(Tcpctl); tpriv->stats[MaxConn] = tcp->nc; Fsproto(fs, tcp); }
  • 10. Closed passive open appl: listen() appl: connect() send: SYN recv: SYN send: SYN, ACK Listen active open recv: SYN Syn_received Syn_sent send: SYN, ACK recv: ACK recv: SYN, ACK Established send: ACK active close recv: FIN Close_wait send: ACK recv: FIN appl: close() Finwait1 send: ACK Closing passive close send: FIN recv: FIN, ACK recv: ACK recv: ACK Last_ack send: ACK 2MSL timeout recv: ACK recv: FIN Finwait2 Time_wait send: ACK ※
  • 11. update: • Tcpctl: TCP TCB • • cwnd: • window: • Limbo: listener
  • 12. • TCP • Reno Tahoe • • Window scaling option
  • 13. • tcpackproc #I0tcpack • 50 expire • • tcb->timer: tcptimeout • tcb->acktimer: tcpacktimer • tcb->katimer: tcpkeepalive • tcb->rtt_timer: RTT
  • 14. • • /net/tcp/*/state • IPv4 IPv4-mapped IPv6
  • 15. qid • • UNIX inode