SlideShare a Scribd company logo
1 of 29
Download to read offline
oraccha
                   Plan9            http://d.hatena.ne.jp/oraccha/

                 2009        11 5                         VM

Thursday, November 5, 2009
Plan 9
                •             Plan 9            ...

                      •      UNIX V1

                      •      xv6

                      •      V7/x86

                      •      2.11BSD

                      •      X Window System


Thursday, November 5, 2009
Plan 9

                4th International Workshop on Plan 9

                                     ...




Thursday, November 5, 2009
•      Plan 9

                •      BSD          dial(2)

                •      acid truss




Thursday, November 5, 2009
Plan 9

                •
                • 9P
                •
Thursday, November 5, 2009
•
                •            open-read-write-close




Thursday, November 5, 2009
...
                                            UNIX
                                     UNIX

                      •
                             •       UCB

                      •      GUI

                             •   X            MIT

Thursday, November 5, 2009
API

                •
                       open-read-write-close

                •      BSD



                •

Thursday, November 5, 2009
/net
                •
                •
                      •      /net/ether0

                      •        /net/^(arp icmp udp tcp)

                      •      /net/^(cs dns)


Thursday, November 5, 2009
/net/tcp
                •      /net/tcp/N

                      •      ctl

                      •      data

                •      /net/tcp/clone
             % lc /net/tcp
             0 1 10 ... clone stats

             % lc /net/tcp/0
             ctl	 	 data	 err	          	   listen	   local	remote	   status

Thursday, November 5, 2009
echo client
       terminal 1:
       % cat /net/tcp/clone          open(“/net/tcp/clone”)
       5                            open(“/net/tcp/*/ctl”)

       % cat > /net/tcp/clone

       connect 204.178.31.2!7
                                                       terminal 2:
                             % cat /net/tcp/5/data &

                             % echo hoge > /net/tcp/5/data

                             echo

Thursday, November 5, 2009
telnet client
           clonefile=/net/tcp/clone
           if(! ~ $#* 2) {
           	 echo Usage: telnet ip port >[1=2]
           	 exit usage
           }

           <[4] $clonefile {
           	 netdir=`{basename -d $clonefile} ^ / ^
           `{cat /fd/4}
           	 echo connect $1!$2 >$netdir/ctl || exit
           'cannot connect'
           	 cat $netdir/data &
           	 cat >$netdir/data
           }
Thursday, November 5, 2009
/net/cs
                •
                •                     clone
                             IP

                      % ndb/csquery

                      > tcp!www.bell-labs.com!http

                      /net/tcp/clone 135.245.1.14!80


Thursday, November 5, 2009
•
                % srv tcp!plan9.bell-labs.com!http foo
                post...
                % netstat -n
                tcp 29 oraccha Established 58069 80 204.178.31.2
                % echo GET /plan9/index.html >>/srv/foo
                % cat /srv/foo
                <?xml version="1.0" encoding="utf-8"?>
                <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
                Transitional//EN"
                "http://www.w3.org/TR/html4/loose.dtd">
                        :
                % rm /srv/foo
Thursday, November 5, 2009
echo
              int fd, n;

              char *name;

              name = netmkaddr(“plan9.bell-labs.com”,
              “tcp”, “echo”);   “204.178.31.2!echo
              fd = dial(name, 0, 0, 0);

                   :
              n = write(fd, buf, sizeof(buf));

              read(1, buf, n);

Thursday, November 5, 2009
echo
              int acfd, lcfd, dfd, n;
              char adir[40], ldir[40]                    /net/tcp/5
              acfd = announce("tcp!*!7", adir);
              for (;;) {                            /net/tcp/6
                  lcfd = listen(adir, ldir);
                  switch (fork()) {                         UNIX
                  case 0:
                      dfd = accept(lcfd, ldir);
                      while ((n = read(dfd, buf, sizeof(buf))) > 0)
                         write(dfd, buf, n);
                      exits(0);
                  }
              }
Thursday, November 5, 2009
BSD
               Plan 9        BSD socket
                dial                      active open fd
                               socket
             announce                     passive open fd
                dial          connect            active open
                  -              bind
             announce           listen
           listen/accept       accept
               reject           close
                  -          shutdown

Thursday, November 5, 2009
•      dial(2)

                      •      /sys/src/libc/9sys/dial.c

                •      announce(2), listen(2), accept(2), reject(2)

                      •      /sys/src/libc/9sys/announce.c

                •      netmkaddr(2)

                      •      /sys/src/libc/port/netmkaddr.c

                •      /net/cs

                      •      /sys/src/cmd/ndb/cs.c
Thursday, November 5, 2009
acid      truss (strace)
                     % acid -l truss a.out
                     a.out:386 plan 9 executable

                     /sys/lib/acid/port
                     /sys/lib/acid/truss
                     /sys/lib/acid/386
                     acid: new()
                     acid: truss()
                             :

Thursday, November 5, 2009
echo           truss                   /
                                          # dial(2)
      open("/net/cs", 2)                    # open connection server
      	 return value: 3
      pwrite(3, "tcp!192.168.0.1!8007", 20, -1) # translate the address
      	 return value: 20
      seek(0x00013e30, 3, 0, 0)
      	 return value: 0
      pread(3, 0x7fffec00, 127, -1)
      	 return value: 31
      	 data: "/net/tcp/clone 192.168.0.1!8007"




Thursday, November 5, 2009
echo           truss                      /
       open("/net/tcp/clone", 2)               # open clone file
       	 return value: 4
       pread(4, 0x7fffe7d0, 255, -1)           # get directory name
       	 return value: 2
       	 data: "33"
                                           #   connect(2)
       pwrite(4, "connect 192.168.0.1!8007",   24, -1) # connect
       	 return value: 24
       open("/net/tcp/33/data", 2)             # open data connection
       	 return value: 5
       close(4)                                # close clone file
       	 return value: 0
       close(3)                                # close connection server
       	 return value: 0




Thursday, November 5, 2009
echo           truss                /
                                       # echo
      pread(0, 0x00014aa8, 4096, -1)
      glenda                             # input “glenda” from stdin
      	 return value: 7
      	 data: "glenda
      "
      pwrite(5, "glenda
      ", 8, -1)
      	 return value: 8
      pread(5, 0x7fffee5c, 256, -1)
      	 return value: 8
      	 data: "glenda
      "
      pwrite(1, "glenda
      ", 8, -1)
      glenda                             # output “glenda” to stdout
      	 return value: 8

Thursday, November 5, 2009
echod               truss                 /
                                         # announce(2)
       open("/net/cs", 2)                  # open connection server
       	 return value: 3
       pwrite(3, "tcp!*!8007", 10, -1)     # translate the address
       	 return value: 10
       seek(0x00007a94, 3, 0, 0)
       	 return value: 0
       pread(3, 0x7fffe8b4, 255, -1)
       	 return value: 19
       	 data: "/net/tcp/clone 8007"
       close(3)                            # close connection server
       	 return value: 0




Thursday, November 5, 2009
echod              truss                     /
       open("/net/tcp/clone", 2)              # open clone file
       	 return value: 3
       pread(3, 0x7fffece9, 246, -1)          # get directory name
       	 return value: 2
       	 data: "29"
       pwrite(3, "announce 8007", 13, -1)     # announce service
       	 return value: 13
                                            # listen(2)
       open("/net/tcp/29/listen", 2)          # open listen file
       	 return value: 4
       pread(4, 0x7fffece9, 246, -1)          # get directory name
       	 return value: 2
       	 data: "34"




Thursday, November 5, 2009
echod              truss                /
                                       # accept(2)
       pwrite(4, "accept 34", 9, -1)     # accept a call
       	 return value: -1                # (ignore return value)
       open("/net/tcp/34/data", 2)       # open data file
       	 return value: 5
                                       # echod
       pread(5, 0x7fffee04, 256, -1)
       	 return value: 8
       	 data: "glenda
       "
       pwrite(5, "glenda
       ", 8, -1)
       	 return value: 8




Thursday, November 5, 2009
•      man dial(2)

                •      Pegasus by

                      •      http://plan9.aichi-u.ac.jp/pegasus/




Thursday, November 5, 2009
TODO
                •
                      •      TCP/IP

                             •   TCP: 3200

                             •   UDP: 620

                      •
Thursday, November 5, 2009
•
                      •      open-close-read-write



                •      Plan 9



                •
Thursday, November 5, 2009
Plan9   http://d.hatena.ne.jp/oraccha/
Thursday, November 5, 2009

More Related Content

Viewers also liked

xv6のコンテキストスイッチを読む
xv6のコンテキストスイッチを読むxv6のコンテキストスイッチを読む
xv6のコンテキストスイッチを読むmfumi
 
x86とコンテキストスイッチ
x86とコンテキストスイッチx86とコンテキストスイッチ
x86とコンテキストスイッチMasami Ichikawa
 
とある帽子の大蛇料理Ⅱ
とある帽子の大蛇料理Ⅱとある帽子の大蛇料理Ⅱ
とある帽子の大蛇料理ⅡMasami Ichikawa
 
100Gbpsソフトウェアルータの実現可能性に関する論文
100Gbpsソフトウェアルータの実現可能性に関する論文100Gbpsソフトウェアルータの実現可能性に関する論文
100Gbpsソフトウェアルータの実現可能性に関する論文y_uuki
 
User-space Network Processing
User-space Network ProcessingUser-space Network Processing
User-space Network ProcessingRyousei Takano
 
デバドラを書いてみよう!
デバドラを書いてみよう!デバドラを書いてみよう!
デバドラを書いてみよう!Masami Ichikawa
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜Ryousei Takano
 
Disruptive IP Networking with Intel DPDK on Linux
Disruptive IP Networking with Intel DPDK on LinuxDisruptive IP Networking with Intel DPDK on Linux
Disruptive IP Networking with Intel DPDK on LinuxNaoto MATSUMOTO
 
クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価Ryousei Takano
 
Xeon dとlagopusと、pktgen dpdk
Xeon dとlagopusと、pktgen dpdkXeon dとlagopusと、pktgen dpdk
Xeon dとlagopusと、pktgen dpdkMasaru Oki
 
Dpdk環境の話
Dpdk環境の話Dpdk環境の話
Dpdk環境の話Masaru Oki
 
Intel 82599 10GbE Controllerで遊ぼう
Intel 82599 10GbE Controllerで遊ぼうIntel 82599 10GbE Controllerで遊ぼう
Intel 82599 10GbE Controllerで遊ぼうTakuya ASADA
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化Takuya ASADA
 

Viewers also liked (16)

xv6のコンテキストスイッチを読む
xv6のコンテキストスイッチを読むxv6のコンテキストスイッチを読む
xv6のコンテキストスイッチを読む
 
x86とコンテキストスイッチ
x86とコンテキストスイッチx86とコンテキストスイッチ
x86とコンテキストスイッチ
 
Bish Bash Bosh & Co
Bish Bash Bosh & Co Bish Bash Bosh & Co
Bish Bash Bosh & Co
 
とある帽子の大蛇料理Ⅱ
とある帽子の大蛇料理Ⅱとある帽子の大蛇料理Ⅱ
とある帽子の大蛇料理Ⅱ
 
πολλαπλασιασμοι ενοτητα 11
πολλαπλασιασμοι ενοτητα 11πολλαπλασιασμοι ενοτητα 11
πολλαπλασιασμοι ενοτητα 11
 
100Gbpsソフトウェアルータの実現可能性に関する論文
100Gbpsソフトウェアルータの実現可能性に関する論文100Gbpsソフトウェアルータの実現可能性に関する論文
100Gbpsソフトウェアルータの実現可能性に関する論文
 
User-space Network Processing
User-space Network ProcessingUser-space Network Processing
User-space Network Processing
 
デバドラを書いてみよう!
デバドラを書いてみよう!デバドラを書いてみよう!
デバドラを書いてみよう!
 
I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜I/O仮想化最前線〜ネットワークI/Oを中心に〜
I/O仮想化最前線〜ネットワークI/Oを中心に〜
 
Disruptive IP Networking with Intel DPDK on Linux
Disruptive IP Networking with Intel DPDK on LinuxDisruptive IP Networking with Intel DPDK on Linux
Disruptive IP Networking with Intel DPDK on Linux
 
クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価クラウド環境におけるキャッシュメモリQoS制御の評価
クラウド環境におけるキャッシュメモリQoS制御の評価
 
DPDKを拡張してみた話し
DPDKを拡張してみた話しDPDKを拡張してみた話し
DPDKを拡張してみた話し
 
Xeon dとlagopusと、pktgen dpdk
Xeon dとlagopusと、pktgen dpdkXeon dとlagopusと、pktgen dpdk
Xeon dとlagopusと、pktgen dpdk
 
Dpdk環境の話
Dpdk環境の話Dpdk環境の話
Dpdk環境の話
 
Intel 82599 10GbE Controllerで遊ぼう
Intel 82599 10GbE Controllerで遊ぼうIntel 82599 10GbE Controllerで遊ぼう
Intel 82599 10GbE Controllerで遊ぼう
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化
 

Similar to あなたの知らないネットワークプログラミングの世界

今日から始めるPlan 9 from Bell Labs
今日から始めるPlan 9 from Bell Labs今日から始めるPlan 9 from Bell Labs
今日から始めるPlan 9 from Bell LabsRyousei Takano
 
What to do when things go wrong
What to do when things go wrongWhat to do when things go wrong
What to do when things go wrongDorneles Treméa
 
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009Jan Wedekind
 
IL: 失われたプロトコル
IL: 失われたプロトコルIL: 失われたプロトコル
IL: 失われたプロトコルRyousei Takano
 
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairHow OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairBruce Elgort
 
Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...
Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...
Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...Go Iwai
 
Python on FreeBSD
Python on FreeBSDPython on FreeBSD
Python on FreeBSDpycontw
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersYury Chemerkin
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - RoutersLogicaltrust pl
 
マッコスXで始めるPlan 9
マッコスXで始めるPlan 9マッコスXで始めるPlan 9
マッコスXで始めるPlan 9Ryousei Takano
 
One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009Philippe Gamache
 
D1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFD1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFAnthony Jose
 
The reports of Perl's death have been greatly exaggerated
The reports of Perl's death have been greatly exaggeratedThe reports of Perl's death have been greatly exaggerated
The reports of Perl's death have been greatly exaggeratedDominique Dumont
 
Configuration surgery with Augeas (OggCamp 12)
Configuration surgery with Augeas (OggCamp 12)Configuration surgery with Augeas (OggCamp 12)
Configuration surgery with Augeas (OggCamp 12)Dominic Cleal
 
Keynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics StudiesKeynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics StudiesESEM 2014
 
Deployment tales
Deployment talesDeployment tales
Deployment talesAmoniac OÜ
 

Similar to あなたの知らないネットワークプログラミングの世界 (20)

Plan 9のお話
Plan 9のお話Plan 9のお話
Plan 9のお話
 
今日から始めるPlan 9 from Bell Labs
今日から始めるPlan 9 from Bell Labs今日から始めるPlan 9 from Bell Labs
今日から始めるPlan 9 from Bell Labs
 
What to do when things go wrong
What to do when things go wrongWhat to do when things go wrong
What to do when things go wrong
 
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
 
Intro To Git
Intro To GitIntro To Git
Intro To Git
 
IL: 失われたプロトコル
IL: 失われたプロトコルIL: 失われたプロトコル
IL: 失われたプロトコル
 
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairHow OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
 
Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...
Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...
Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 hel...
 
Unix Ramblings
Unix RamblingsUnix Ramblings
Unix Ramblings
 
Python on FreeBSD
Python on FreeBSDPython on FreeBSD
Python on FreeBSD
 
Filip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routersFilip palian mateuszkocielski. simplest ownage human observed… routers
Filip palian mateuszkocielski. simplest ownage human observed… routers
 
Simplest-Ownage-Human-Observed… - Routers
 Simplest-Ownage-Human-Observed… - Routers Simplest-Ownage-Human-Observed… - Routers
Simplest-Ownage-Human-Observed… - Routers
 
マッコスXで始めるPlan 9
マッコスXで始めるPlan 9マッコスXで始めるPlan 9
マッコスXで始めるPlan 9
 
One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009
 
D1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FFD1T3-Anto-Joseph-Droid-FF
D1T3-Anto-Joseph-Droid-FF
 
The reports of Perl's death have been greatly exaggerated
The reports of Perl's death have been greatly exaggeratedThe reports of Perl's death have been greatly exaggerated
The reports of Perl's death have been greatly exaggerated
 
Configuration surgery with Augeas (OggCamp 12)
Configuration surgery with Augeas (OggCamp 12)Configuration surgery with Augeas (OggCamp 12)
Configuration surgery with Augeas (OggCamp 12)
 
Keynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics StudiesKeynote 1 - Engineering Software Analytics Studies
Keynote 1 - Engineering Software Analytics Studies
 
Deployment tales
Deployment talesDeployment tales
Deployment tales
 
Deployment tales
Deployment talesDeployment tales
Deployment tales
 

More from Ryousei Takano

Error Permissive Computing
Error Permissive ComputingError Permissive Computing
Error Permissive ComputingRyousei Takano
 
Opportunities of ML-based data analytics in ABCI
Opportunities of ML-based data analytics in ABCIOpportunities of ML-based data analytics in ABCI
Opportunities of ML-based data analytics in ABCIRyousei Takano
 
ABCI: An Open Innovation Platform for Advancing AI Research and Deployment
ABCI: An Open Innovation Platform for Advancing AI Research and DeploymentABCI: An Open Innovation Platform for Advancing AI Research and Deployment
ABCI: An Open Innovation Platform for Advancing AI Research and DeploymentRyousei Takano
 
USENIX NSDI 2016 (Session: Resource Sharing)
USENIX NSDI 2016 (Session: Resource Sharing)USENIX NSDI 2016 (Session: Resource Sharing)
USENIX NSDI 2016 (Session: Resource Sharing)Ryousei Takano
 
Flow-centric Computing - A Datacenter Architecture in the Post Moore Era
Flow-centric Computing - A Datacenter Architecture in the Post Moore EraFlow-centric Computing - A Datacenter Architecture in the Post Moore Era
Flow-centric Computing - A Datacenter Architecture in the Post Moore EraRyousei Takano
 
A Look Inside Google’s Data Center Networks
A Look Inside Google’s Data Center NetworksA Look Inside Google’s Data Center Networks
A Look Inside Google’s Data Center NetworksRyousei Takano
 
クラウド時代の半導体メモリー技術
クラウド時代の半導体メモリー技術クラウド時代の半導体メモリー技術
クラウド時代の半導体メモリー技術Ryousei Takano
 
AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...Ryousei Takano
 
IEEE CloudCom 2014参加報告
IEEE CloudCom 2014参加報告IEEE CloudCom 2014参加報告
IEEE CloudCom 2014参加報告Ryousei Takano
 
Expectations for optical network from the viewpoint of system software research
Expectations for optical network from the viewpoint of system software researchExpectations for optical network from the viewpoint of system software research
Expectations for optical network from the viewpoint of system software researchRyousei Takano
 
Exploring the Performance Impact of Virtualization on an HPC Cloud
Exploring the Performance Impact of Virtualization on an HPC CloudExploring the Performance Impact of Virtualization on an HPC Cloud
Exploring the Performance Impact of Virtualization on an HPC CloudRyousei Takano
 
不揮発メモリとOS研究にまつわる何か
不揮発メモリとOS研究にまつわる何か不揮発メモリとOS研究にまつわる何か
不揮発メモリとOS研究にまつわる何かRyousei Takano
 
High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...
High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...
High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...Ryousei Takano
 
クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~
クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~
クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~Ryousei Takano
 
From Rack scale computers to Warehouse scale computers
From Rack scale computers to Warehouse scale computersFrom Rack scale computers to Warehouse scale computers
From Rack scale computers to Warehouse scale computersRyousei Takano
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green CloudRyousei Takano
 
Iris: Inter-cloud Resource Integration System for Elastic Cloud Data Center
Iris: Inter-cloud Resource Integration System for Elastic Cloud Data CenterIris: Inter-cloud Resource Integration System for Elastic Cloud Data Center
Iris: Inter-cloud Resource Integration System for Elastic Cloud Data CenterRyousei Takano
 
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...Ryousei Takano
 

More from Ryousei Takano (20)

Error Permissive Computing
Error Permissive ComputingError Permissive Computing
Error Permissive Computing
 
Opportunities of ML-based data analytics in ABCI
Opportunities of ML-based data analytics in ABCIOpportunities of ML-based data analytics in ABCI
Opportunities of ML-based data analytics in ABCI
 
ABCI: An Open Innovation Platform for Advancing AI Research and Deployment
ABCI: An Open Innovation Platform for Advancing AI Research and DeploymentABCI: An Open Innovation Platform for Advancing AI Research and Deployment
ABCI: An Open Innovation Platform for Advancing AI Research and Deployment
 
ABCI Data Center
ABCI Data CenterABCI Data Center
ABCI Data Center
 
USENIX NSDI 2016 (Session: Resource Sharing)
USENIX NSDI 2016 (Session: Resource Sharing)USENIX NSDI 2016 (Session: Resource Sharing)
USENIX NSDI 2016 (Session: Resource Sharing)
 
Flow-centric Computing - A Datacenter Architecture in the Post Moore Era
Flow-centric Computing - A Datacenter Architecture in the Post Moore EraFlow-centric Computing - A Datacenter Architecture in the Post Moore Era
Flow-centric Computing - A Datacenter Architecture in the Post Moore Era
 
A Look Inside Google’s Data Center Networks
A Look Inside Google’s Data Center NetworksA Look Inside Google’s Data Center Networks
A Look Inside Google’s Data Center Networks
 
クラウド時代の半導体メモリー技術
クラウド時代の半導体メモリー技術クラウド時代の半導体メモリー技術
クラウド時代の半導体メモリー技術
 
AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...
 
IEEE CloudCom 2014参加報告
IEEE CloudCom 2014参加報告IEEE CloudCom 2014参加報告
IEEE CloudCom 2014参加報告
 
Expectations for optical network from the viewpoint of system software research
Expectations for optical network from the viewpoint of system software researchExpectations for optical network from the viewpoint of system software research
Expectations for optical network from the viewpoint of system software research
 
Exploring the Performance Impact of Virtualization on an HPC Cloud
Exploring the Performance Impact of Virtualization on an HPC CloudExploring the Performance Impact of Virtualization on an HPC Cloud
Exploring the Performance Impact of Virtualization on an HPC Cloud
 
不揮発メモリとOS研究にまつわる何か
不揮発メモリとOS研究にまつわる何か不揮発メモリとOS研究にまつわる何か
不揮発メモリとOS研究にまつわる何か
 
High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...
High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...
High-resolution Timer-based Packet Pacing Mechanism on the Linux Operating Sy...
 
クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~
クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~
クラウドの垣根を超えた高性能計算に向けて~AIST Super Green Cloudでの試み~
 
From Rack scale computers to Warehouse scale computers
From Rack scale computers to Warehouse scale computersFrom Rack scale computers to Warehouse scale computers
From Rack scale computers to Warehouse scale computers
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
 
Iris: Inter-cloud Resource Integration System for Elastic Cloud Data Center
Iris: Inter-cloud Resource Integration System for Elastic Cloud Data CenterIris: Inter-cloud Resource Integration System for Elastic Cloud Data Center
Iris: Inter-cloud Resource Integration System for Elastic Cloud Data Center
 
IEEE/ACM SC2013報告
IEEE/ACM SC2013報告IEEE/ACM SC2013報告
IEEE/ACM SC2013報告
 
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
A Scalable and Distributed Electrical Power Monitoring System Utilizing Cloud...
 

Recently uploaded

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 

Recently uploaded (20)

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 

あなたの知らないネットワークプログラミングの世界

  • 1. oraccha Plan9 http://d.hatena.ne.jp/oraccha/ 2009 11 5 VM Thursday, November 5, 2009
  • 2. Plan 9 • Plan 9 ... • UNIX V1 • xv6 • V7/x86 • 2.11BSD • X Window System Thursday, November 5, 2009
  • 3. Plan 9 4th International Workshop on Plan 9 ... Thursday, November 5, 2009
  • 4. Plan 9 • BSD dial(2) • acid truss Thursday, November 5, 2009
  • 5. Plan 9 • • 9P • Thursday, November 5, 2009
  • 6. • open-read-write-close Thursday, November 5, 2009
  • 7. ... UNIX UNIX • • UCB • GUI • X MIT Thursday, November 5, 2009
  • 8. API • open-read-write-close • BSD • Thursday, November 5, 2009
  • 9. /net • • • /net/ether0 • /net/^(arp icmp udp tcp) • /net/^(cs dns) Thursday, November 5, 2009
  • 10. /net/tcp • /net/tcp/N • ctl • data • /net/tcp/clone % lc /net/tcp 0 1 10 ... clone stats % lc /net/tcp/0 ctl data err listen local remote status Thursday, November 5, 2009
  • 11. echo client terminal 1: % cat /net/tcp/clone open(“/net/tcp/clone”) 5 open(“/net/tcp/*/ctl”) % cat > /net/tcp/clone connect 204.178.31.2!7 terminal 2: % cat /net/tcp/5/data & % echo hoge > /net/tcp/5/data echo Thursday, November 5, 2009
  • 12. telnet client clonefile=/net/tcp/clone if(! ~ $#* 2) { echo Usage: telnet ip port >[1=2] exit usage } <[4] $clonefile { netdir=`{basename -d $clonefile} ^ / ^ `{cat /fd/4} echo connect $1!$2 >$netdir/ctl || exit 'cannot connect' cat $netdir/data & cat >$netdir/data } Thursday, November 5, 2009
  • 13. /net/cs • • clone IP % ndb/csquery > tcp!www.bell-labs.com!http /net/tcp/clone 135.245.1.14!80 Thursday, November 5, 2009
  • 14. % srv tcp!plan9.bell-labs.com!http foo post... % netstat -n tcp 29 oraccha Established 58069 80 204.178.31.2 % echo GET /plan9/index.html >>/srv/foo % cat /srv/foo <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> : % rm /srv/foo Thursday, November 5, 2009
  • 15. echo int fd, n; char *name; name = netmkaddr(“plan9.bell-labs.com”, “tcp”, “echo”); “204.178.31.2!echo fd = dial(name, 0, 0, 0); : n = write(fd, buf, sizeof(buf)); read(1, buf, n); Thursday, November 5, 2009
  • 16. echo int acfd, lcfd, dfd, n; char adir[40], ldir[40] /net/tcp/5 acfd = announce("tcp!*!7", adir); for (;;) { /net/tcp/6 lcfd = listen(adir, ldir); switch (fork()) { UNIX case 0: dfd = accept(lcfd, ldir); while ((n = read(dfd, buf, sizeof(buf))) > 0) write(dfd, buf, n); exits(0); } } Thursday, November 5, 2009
  • 17. BSD Plan 9 BSD socket dial active open fd socket announce passive open fd dial connect active open - bind announce listen listen/accept accept reject close - shutdown Thursday, November 5, 2009
  • 18. dial(2) • /sys/src/libc/9sys/dial.c • announce(2), listen(2), accept(2), reject(2) • /sys/src/libc/9sys/announce.c • netmkaddr(2) • /sys/src/libc/port/netmkaddr.c • /net/cs • /sys/src/cmd/ndb/cs.c Thursday, November 5, 2009
  • 19. acid truss (strace) % acid -l truss a.out a.out:386 plan 9 executable /sys/lib/acid/port /sys/lib/acid/truss /sys/lib/acid/386 acid: new() acid: truss() : Thursday, November 5, 2009
  • 20. echo truss / # dial(2) open("/net/cs", 2) # open connection server return value: 3 pwrite(3, "tcp!192.168.0.1!8007", 20, -1) # translate the address return value: 20 seek(0x00013e30, 3, 0, 0) return value: 0 pread(3, 0x7fffec00, 127, -1) return value: 31 data: "/net/tcp/clone 192.168.0.1!8007" Thursday, November 5, 2009
  • 21. echo truss / open("/net/tcp/clone", 2) # open clone file return value: 4 pread(4, 0x7fffe7d0, 255, -1) # get directory name return value: 2 data: "33" # connect(2) pwrite(4, "connect 192.168.0.1!8007", 24, -1) # connect return value: 24 open("/net/tcp/33/data", 2) # open data connection return value: 5 close(4) # close clone file return value: 0 close(3) # close connection server return value: 0 Thursday, November 5, 2009
  • 22. echo truss / # echo pread(0, 0x00014aa8, 4096, -1) glenda # input “glenda” from stdin return value: 7 data: "glenda " pwrite(5, "glenda ", 8, -1) return value: 8 pread(5, 0x7fffee5c, 256, -1) return value: 8 data: "glenda " pwrite(1, "glenda ", 8, -1) glenda # output “glenda” to stdout return value: 8 Thursday, November 5, 2009
  • 23. echod truss / # announce(2) open("/net/cs", 2) # open connection server return value: 3 pwrite(3, "tcp!*!8007", 10, -1) # translate the address return value: 10 seek(0x00007a94, 3, 0, 0) return value: 0 pread(3, 0x7fffe8b4, 255, -1) return value: 19 data: "/net/tcp/clone 8007" close(3) # close connection server return value: 0 Thursday, November 5, 2009
  • 24. echod truss / open("/net/tcp/clone", 2) # open clone file return value: 3 pread(3, 0x7fffece9, 246, -1) # get directory name return value: 2 data: "29" pwrite(3, "announce 8007", 13, -1) # announce service return value: 13 # listen(2) open("/net/tcp/29/listen", 2) # open listen file return value: 4 pread(4, 0x7fffece9, 246, -1) # get directory name return value: 2 data: "34" Thursday, November 5, 2009
  • 25. echod truss / # accept(2) pwrite(4, "accept 34", 9, -1) # accept a call return value: -1 # (ignore return value) open("/net/tcp/34/data", 2) # open data file return value: 5 # echod pread(5, 0x7fffee04, 256, -1) return value: 8 data: "glenda " pwrite(5, "glenda ", 8, -1) return value: 8 Thursday, November 5, 2009
  • 26. man dial(2) • Pegasus by • http://plan9.aichi-u.ac.jp/pegasus/ Thursday, November 5, 2009
  • 27. TODO • • TCP/IP • TCP: 3200 • UDP: 620 • Thursday, November 5, 2009
  • 28. • open-close-read-write • Plan 9 • Thursday, November 5, 2009
  • 29. Plan9 http://d.hatena.ne.jp/oraccha/ Thursday, November 5, 2009