SlideShare a Scribd company logo
Networking
 by Example!
        Noury Bouraqadi
http://car.mines-douai.fr/noury

  "Deep Into Smalltalk" Spring School
     8 march 2011 - Lille, France
2


                   Agenda
•  Networking Basics
  –  Sockets and protocols
  –  Client vs. Server
  –  Hands-on with SocketStream

•  Serving
  –  Connection vs. communication
  –  Hands-on Concurrency!

•  Complex interactions
  –  Exchanging objects over a network
  –  Remote messaging Hands-on
3




 Software                          Software
                 Nework

Process                              Process
            Soc
                ke        oc ket
                     t   S

    Bi-directional communication
4




   Device A                          Device B

 Software                              Software
                   Nework

Process                                  Process
              Soc
                  ke        oc ket
                       t   S
5




                Device Z

 Software                          Software
                 Nework

Process                              Process
            Soc
                ke        oc ket
                     t   S
6


                 2 Main
                Transport
                Protocols


          TCP               UDP


Transmission                    User
   Control                    Datagram
  Protocol                    Protocol
7


                  2 Main
                 Transport
                 Protocols


          TCP                UDP


•  Connected                 •  Connection free
   •  Reliable                   •  Unreliable
  •  Streams                    •  Limited size
8


Focus


                 SSH


    POP
                 TCP         SMTP



          HTTP         FTP
9

    Connection
     Handling
     Process




Server



                 Client A
                 Communication
                   Process
10

    Connection
     Handling
     Process




Server



                   Client A
   Communication   Communication
     Process         Process
11

    Connection
     Handling
     Process




Server             Client B
                   Communication
                     Process


                   Client A
   Communication   Communication
     Process         Process
12

    Connection
     Handling
     Process




Server             Client B
   Communication   Communication
     Process         Process


                   Client A
   Communication   Communication
     Process         Process
13

    Connection
     Handling
     Process       Client C
                   Communication
                     Process



Server             Client B
   Communication   Communication
     Process         Process


                   Client A
   Communication   Communication
     Process         Process
14

    Connection
     Handling
     Process       Client C
   Communication   Communication
     Process         Process



Server             Client B
   Communication   Communication
     Process         Process


                   Client A
   Communication   Communication
     Process         Process
15




  Client Socket
 So cketS tream!
1.  Connect to a server
2.  Send a String
3.  Receive a String
4.  Close
16


         Server for Tests

            Serve
                            Unix!
echo "Smalltalk" | nc –lk 12345

    Multiple
                         Port
  connections
                        number
17




|stream|
stream := SocketStream
   openConnectionToHostNamed: 'localhost'
   port: 12345.
[
   stream sendCommand: 'Pharo’.
   Transcript cr; show: (stream nextLineLf).
] ensure: [
   stream close]
18




Simplest Possible Server
1.  Listen on some port
2.  Accept 1 single client connection
3.  Send a String
4.  Receive a String
5.  Close
19


          Client for Tests

              Host
                               Unix!
echo "Smalltalk" | nc localhost 12345


                           Port
                          number
20




connectionSock := Socket newTCP.
[
  connectionSock listenOn: 12345 backlogSize: 10.
  interactSock := connectionSock
                             waitForAcceptFor: 30.
  stream := SocketStream on: interactSock.
  stream sendCommand: 'Pharo Server!’.
  Transcript cr; show: stream nextLineLf.
] ensure: [
  connectionSock closeAndDestroy.
  stream close.]
21




                                      Tw itter
Luc: I’m struggling with the robots
----------
Noury: Which robots? WifiBots or
Robulabs?
----------
                                       like
Luc: I need to setup the internal board of
Robulab #2
----------
22




         Multi-threaded
             Server

                             1 process
                          for connections
   1 process
for each client

                  Sycnrhonization
                     is needed
23




         Multi-threaded
                              fork
             Server

                             1 process
                          for connections
   1 process
for each client   Mutex
                  Sycnrhonization
                     is needed
   critical:
24




Socket   10110101   Socket
  1                   2
         Network
25


        Copying an object !

10@34                         10@34




                              110101
 1011




Socket        10110101    Socket
  1                         2
              Network
26




    ReferenceStream




streamed
           Represen
                      tationOf: 1
                                 0@34
27




Classes should be
  on both sides
28


Remote messaging




     Network
29




proxy               dispatcher




Socket                Socket
  1      10110101       2

         Network
30




                                     id3

                               id1



proxy
                    dispatcher
 id1



Socket                Socket
  1      10110101       2

         Network
31




 Remote
Transcript
32



                      Code
          Proxy    Deployment


                      Message
(De-)Serializing   passing control
   Messages


  Argument           Garbage
    passing         Collection?
 by reference
33




           Proxy


                        Message
                     passing control

doesNotUnderstand:
34




               ReferenceStream



                   unStream: aString
(De-)Serializing
   Messages


streamedRepresentationOf: anObject
35




What           OCEAN
Next?          New Socket
                 Library
Distributed-
  Objects
    (rST)
a Clean, Portable
Networking Library
Current network library
                               ByteArray
 TCP+              IPv4
UDP+…              +IPv6


          Socket              SocketAdress




                                      irty!
 HTTPSocket    SocksSocket
                                     D
                             0%
                           t ested
OCEAN Library
             Socket
   networkLibrary                 NetworkLibraryProxyFactory
   socketID



                                           WindowsLibrary


                                            MacOSLibrary
TcpSocket             UdpSocket


                                            LinuxLibrary


OOP            100%
               tested
                                          NetworkingPlugin
                                           WrapperLibrary
OCEAN Library Lates t
                               ers io n
             Socket           v
   networkLibrary                NetworkLibraryProxyFactory
   socketID



                                          WindowsLibrary


                                           MacOSLibrary
TcpSocket           UdpSocket


                                           LinuxLibrary


               100%      Pharo
OOP                       1.3
               tested
                                         NetworkingPlugin
                                          WrapperLibrary
OCEAN for Pharo 1.3             ALL
                             Primitives !


 Image   Socket         Plugin
         Library       Wrapper



 VM                     Socket
                        Plugin



 OS                   Network API
OCEAN for Pharo 1.4?

                                Posix
Image         Socket
                               Library
              Library
                               Wrapper



VM               Smalltalk       FFI
        OOP        IDE          Plugin



OS                           Posix Library
OCEAN + FFI + Posix

     350
     300
     250
     200                              Ocean
ms




     150                              OldSocket

     100
      50
       0
           Receive 10MB   Send 10MB
Generalization

Image      Library   Library   Library
              A         B         Z



VM                    FFI      Smaller
                                VM

Other OS   API α     API β        API ψ
44

More Related Content

What's hot

A Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End TestingA Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End Testing
SmartBear
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
Ana Sarbescu
 
Эффективные ретроспективы
Эффективные ретроспективыЭффективные ретроспективы
Эффективные ретроспективы
Boris Volfson
 
Continuous Quality with Postman
Continuous Quality with PostmanContinuous Quality with Postman
Continuous Quality with Postman
Postman
 
ZeroMq ZooKeeper and FlatBuffers
ZeroMq ZooKeeper and FlatBuffersZeroMq ZooKeeper and FlatBuffers
ZeroMq ZooKeeper and FlatBuffers
Ravi Okade
 
la complexité des algorithmes en toute simplicité
la complexité des algorithmes en toute simplicitéla complexité des algorithmes en toute simplicité
la complexité des algorithmes en toute simplicité
Sana REFAI
 
Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)
Scott Wlaschin
 
Advanced Testing
Advanced TestingAdvanced Testing
Advanced Testing
Postman
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
QASymphony
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
QASource
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization release
ESUG
 
Designing Good API Experiences Session 24
Designing Good API Experiences Session 24Designing Good API Experiences Session 24
Designing Good API Experiences Session 24
Postman
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.
Deepak Singhvi
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman Introduction
Rahul Agarwal
 
Le système de versioning git
Le système de versioning gitLe système de versioning git
Le système de versioning git
Nassim Bahri
 
Introduction To Appium With Robotframework
Introduction To Appium With RobotframeworkIntroduction To Appium With Robotframework
Introduction To Appium With Robotframework
Syam Sasi
 
Driving Trends PowerPoint Presentation Slides
Driving Trends PowerPoint Presentation Slides Driving Trends PowerPoint Presentation Slides
Driving Trends PowerPoint Presentation Slides
SlideTeam
 
Papel do QA na Transformação Ágil
Papel do QA na Transformação ÁgilPapel do QA na Transformação Ágil
Papel do QA na Transformação Ágil
Elias Nogueira
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
Mario Fusco
 

What's hot (20)

A Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End TestingA Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End Testing
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Эффективные ретроспективы
Эффективные ретроспективыЭффективные ретроспективы
Эффективные ретроспективы
 
Continuous Quality with Postman
Continuous Quality with PostmanContinuous Quality with Postman
Continuous Quality with Postman
 
ZeroMq ZooKeeper and FlatBuffers
ZeroMq ZooKeeper and FlatBuffersZeroMq ZooKeeper and FlatBuffers
ZeroMq ZooKeeper and FlatBuffers
 
la complexité des algorithmes en toute simplicité
la complexité des algorithmes en toute simplicitéla complexité des algorithmes en toute simplicité
la complexité des algorithmes en toute simplicité
 
Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)Functional Programming Patterns (NDC London 2014)
Functional Programming Patterns (NDC London 2014)
 
Advanced Testing
Advanced TestingAdvanced Testing
Advanced Testing
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
 
Pharo 11: A stabilization release
Pharo 11: A stabilization releasePharo 11: A stabilization release
Pharo 11: A stabilization release
 
Основы MATLAB. Лекция 1.
Основы MATLAB. Лекция 1.Основы MATLAB. Лекция 1.
Основы MATLAB. Лекция 1.
 
Designing Good API Experiences Session 24
Designing Good API Experiences Session 24Designing Good API Experiences Session 24
Designing Good API Experiences Session 24
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.
 
Postman Introduction
Postman IntroductionPostman Introduction
Postman Introduction
 
Le système de versioning git
Le système de versioning gitLe système de versioning git
Le système de versioning git
 
Introduction To Appium With Robotframework
Introduction To Appium With RobotframeworkIntroduction To Appium With Robotframework
Introduction To Appium With Robotframework
 
Driving Trends PowerPoint Presentation Slides
Driving Trends PowerPoint Presentation Slides Driving Trends PowerPoint Presentation Slides
Driving Trends PowerPoint Presentation Slides
 
Papel do QA na Transformação Ágil
Papel do QA na Transformação ÁgilPapel do QA na Transformação Ágil
Papel do QA na Transformação Ágil
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 

Similar to Pharo Networking by Example

Np unit1
Np unit1Np unit1
Np unit1
vamsitricks
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
UC San Diego
 
Group 3 Presen.pptx
Group 3 Presen.pptxGroup 3 Presen.pptx
Group 3 Presen.pptx
StudyvAbhi
 
Hungary Usergroup - Midonet overlay programming
Hungary Usergroup - Midonet overlay programmingHungary Usergroup - Midonet overlay programming
Hungary Usergroup - Midonet overlay programming
Marton Kiss
 
Deep Dive Into Quantum
Deep Dive Into QuantumDeep Dive Into Quantum
Deep Dive Into Quantum
OpenCity Community
 
Introduzione a Software Define Networking
Introduzione a Software Define NetworkingIntroduzione a Software Define Networking
Introduzione a Software Define Networking
festival ICT 2016
 
Open stack with_openflowsdn-torii
Open stack with_openflowsdn-toriiOpen stack with_openflowsdn-torii
Open stack with_openflowsdn-torii
Hui Cheng
 
Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015
SDN Hub
 
SDN: an introduction
SDN: an introductionSDN: an introduction
SDN: an introduction
Luca Profico
 
B21DA0201_04.ppt
B21DA0201_04.pptB21DA0201_04.ppt
B21DA0201_04.ppt
DrPreethiD1
 
Client server
Client serverClient server
Client server
maryam1231
 
Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDP
sangusajjan
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
Thomas Graf
 
Network Virtualization & Software-defined Networking
Network Virtualization & Software-defined NetworkingNetwork Virtualization & Software-defined Networking
Network Virtualization & Software-defined Networking
Digicomp Academy AG
 
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Kishor Datta Gupta
 
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Sajib Sen
 
Networking is NOT Free: Lessons in Network Design
Networking is NOT Free: Lessons in Network DesignNetworking is NOT Free: Lessons in Network Design
Networking is NOT Free: Lessons in Network Design
Randy Bias
 
JDO 2019: Service mesh with Istio - Mariusz Gil
JDO 2019: Service mesh with Istio - Mariusz GilJDO 2019: Service mesh with Istio - Mariusz Gil
JDO 2019: Service mesh with Istio - Mariusz Gil
PROIDEA
 
Chapter 3 - Transport Layer for VN Students
Chapter 3 - Transport Layer for VN StudentsChapter 3 - Transport Layer for VN Students
Chapter 3 - Transport Layer for VN Students
alberttochiro
 
App layer
App layerApp layer
App layer
khushali_modi
 

Similar to Pharo Networking by Example (20)

Np unit1
Np unit1Np unit1
Np unit1
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
 
Group 3 Presen.pptx
Group 3 Presen.pptxGroup 3 Presen.pptx
Group 3 Presen.pptx
 
Hungary Usergroup - Midonet overlay programming
Hungary Usergroup - Midonet overlay programmingHungary Usergroup - Midonet overlay programming
Hungary Usergroup - Midonet overlay programming
 
Deep Dive Into Quantum
Deep Dive Into QuantumDeep Dive Into Quantum
Deep Dive Into Quantum
 
Introduzione a Software Define Networking
Introduzione a Software Define NetworkingIntroduzione a Software Define Networking
Introduzione a Software Define Networking
 
Open stack with_openflowsdn-torii
Open stack with_openflowsdn-toriiOpen stack with_openflowsdn-torii
Open stack with_openflowsdn-torii
 
Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015
 
SDN: an introduction
SDN: an introductionSDN: an introduction
SDN: an introduction
 
B21DA0201_04.ppt
B21DA0201_04.pptB21DA0201_04.ppt
B21DA0201_04.ppt
 
Client server
Client serverClient server
Client server
 
Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDP
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
 
Network Virtualization & Software-defined Networking
Network Virtualization & Software-defined NetworkingNetwork Virtualization & Software-defined Networking
Network Virtualization & Software-defined Networking
 
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
 
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
Leveraging Machine Learning Approach to Setup Software Defined Network(SDN) C...
 
Networking is NOT Free: Lessons in Network Design
Networking is NOT Free: Lessons in Network DesignNetworking is NOT Free: Lessons in Network Design
Networking is NOT Free: Lessons in Network Design
 
JDO 2019: Service mesh with Istio - Mariusz Gil
JDO 2019: Service mesh with Istio - Mariusz GilJDO 2019: Service mesh with Istio - Mariusz Gil
JDO 2019: Service mesh with Istio - Mariusz Gil
 
Chapter 3 - Transport Layer for VN Students
Chapter 3 - Transport Layer for VN StudentsChapter 3 - Transport Layer for VN Students
Chapter 3 - Transport Layer for VN Students
 
App layer
App layerApp layer
App layer
 

More from Noury Bouraqadi

PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi
 
PharoJS for Real World Applications
PharoJS for Real World ApplicationsPharoJS for Real World Applications
PharoJS for Real World Applications
Noury Bouraqadi
 
Client-Server Development with PharoJS
Client-Server Development with PharoJSClient-Server Development with PharoJS
Client-Server Development with PharoJS
Noury Bouraqadi
 
ALPAGA : An AeriaL Platform for sampling Atmospheric Gases and Aerosols
ALPAGA : An AeriaL Platform for sampling Atmospheric Gases and AerosolsALPAGA : An AeriaL Platform for sampling Atmospheric Gases and Aerosols
ALPAGA : An AeriaL Platform for sampling Atmospheric Gases and Aerosols
Noury Bouraqadi
 
PharoJS ESUG 2019 Update
PharoJS ESUG 2019 UpdatePharoJS ESUG 2019 Update
PharoJS ESUG 2019 Update
Noury Bouraqadi
 
UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)
UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)
UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)
Noury Bouraqadi
 
On 2D SLAM for Large Indoor Spaces: A Polygon-Based Solution
On 2D SLAM for Large Indoor Spaces: A Polygon-Based SolutionOn 2D SLAM for Large Indoor Spaces: A Polygon-Based Solution
On 2D SLAM for Large Indoor Spaces: A Polygon-Based Solution
Noury Bouraqadi
 
Towards Live Programming in ROS with PhaROS and LRP
Towards Live Programming in ROS with PhaROS and LRPTowards Live Programming in ROS with PhaROS and LRP
Towards Live Programming in ROS with PhaROS and LRP
Noury Bouraqadi
 
Talking to Robots with Pharo
Talking to Robots with PharoTalking to Robots with Pharo
Talking to Robots with Pharo
Noury Bouraqadi
 
First Tests of a Helper Robot in a Shopping Mall
First Tests of a Helper Robot in a Shopping MallFirst Tests of a Helper Robot in a Shopping Mall
First Tests of a Helper Robot in a Shopping Mall
Noury Bouraqadi
 
Towards Test-Driven Development for Mobile Robots
Towards Test-Driven Development for Mobile RobotsTowards Test-Driven Development for Mobile Robots
Towards Test-Driven Development for Mobile Robots
Noury Bouraqadi
 
Smalltalk to Rule all Robots
Smalltalk to Rule all RobotsSmalltalk to Rule all Robots
Smalltalk to Rule all Robots
Noury Bouraqadi
 
Ocean update - ESUG Conf 2011 @ Edinburgh
Ocean update - ESUG Conf 2011 @ Edinburgh Ocean update - ESUG Conf 2011 @ Edinburgh
Ocean update - ESUG Conf 2011 @ Edinburgh
Noury Bouraqadi
 
Robots Mobiles & Autonomes avec Pharo
Robots Mobiles & Autonomes avec PharoRobots Mobiles & Autonomes avec Pharo
Robots Mobiles & Autonomes avec Pharo
Noury Bouraqadi
 

More from Noury Bouraqadi (14)

PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
 
PharoJS for Real World Applications
PharoJS for Real World ApplicationsPharoJS for Real World Applications
PharoJS for Real World Applications
 
Client-Server Development with PharoJS
Client-Server Development with PharoJSClient-Server Development with PharoJS
Client-Server Development with PharoJS
 
ALPAGA : An AeriaL Platform for sampling Atmospheric Gases and Aerosols
ALPAGA : An AeriaL Platform for sampling Atmospheric Gases and AerosolsALPAGA : An AeriaL Platform for sampling Atmospheric Gases and Aerosols
ALPAGA : An AeriaL Platform for sampling Atmospheric Gases and Aerosols
 
PharoJS ESUG 2019 Update
PharoJS ESUG 2019 UpdatePharoJS ESUG 2019 Update
PharoJS ESUG 2019 Update
 
UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)
UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)
UbiquiTalk - An Infrastructure for Ubiquitous Computing (ESUG 2006)
 
On 2D SLAM for Large Indoor Spaces: A Polygon-Based Solution
On 2D SLAM for Large Indoor Spaces: A Polygon-Based SolutionOn 2D SLAM for Large Indoor Spaces: A Polygon-Based Solution
On 2D SLAM for Large Indoor Spaces: A Polygon-Based Solution
 
Towards Live Programming in ROS with PhaROS and LRP
Towards Live Programming in ROS with PhaROS and LRPTowards Live Programming in ROS with PhaROS and LRP
Towards Live Programming in ROS with PhaROS and LRP
 
Talking to Robots with Pharo
Talking to Robots with PharoTalking to Robots with Pharo
Talking to Robots with Pharo
 
First Tests of a Helper Robot in a Shopping Mall
First Tests of a Helper Robot in a Shopping MallFirst Tests of a Helper Robot in a Shopping Mall
First Tests of a Helper Robot in a Shopping Mall
 
Towards Test-Driven Development for Mobile Robots
Towards Test-Driven Development for Mobile RobotsTowards Test-Driven Development for Mobile Robots
Towards Test-Driven Development for Mobile Robots
 
Smalltalk to Rule all Robots
Smalltalk to Rule all RobotsSmalltalk to Rule all Robots
Smalltalk to Rule all Robots
 
Ocean update - ESUG Conf 2011 @ Edinburgh
Ocean update - ESUG Conf 2011 @ Edinburgh Ocean update - ESUG Conf 2011 @ Edinburgh
Ocean update - ESUG Conf 2011 @ Edinburgh
 
Robots Mobiles & Autonomes avec Pharo
Robots Mobiles & Autonomes avec PharoRobots Mobiles & Autonomes avec Pharo
Robots Mobiles & Autonomes avec Pharo
 

Recently uploaded

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 

Recently uploaded (20)

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 

Pharo Networking by Example

  • 1. Networking by Example! Noury Bouraqadi http://car.mines-douai.fr/noury "Deep Into Smalltalk" Spring School 8 march 2011 - Lille, France
  • 2. 2 Agenda •  Networking Basics –  Sockets and protocols –  Client vs. Server –  Hands-on with SocketStream •  Serving –  Connection vs. communication –  Hands-on Concurrency! •  Complex interactions –  Exchanging objects over a network –  Remote messaging Hands-on
  • 3. 3 Software Software Nework Process Process Soc ke oc ket t S Bi-directional communication
  • 4. 4 Device A Device B Software Software Nework Process Process Soc ke oc ket t S
  • 5. 5 Device Z Software Software Nework Process Process Soc ke oc ket t S
  • 6. 6 2 Main Transport Protocols TCP UDP Transmission User Control Datagram Protocol Protocol
  • 7. 7 2 Main Transport Protocols TCP UDP •  Connected •  Connection free •  Reliable •  Unreliable •  Streams •  Limited size
  • 8. 8 Focus SSH POP TCP SMTP HTTP FTP
  • 9. 9 Connection Handling Process Server Client A Communication Process
  • 10. 10 Connection Handling Process Server Client A Communication Communication Process Process
  • 11. 11 Connection Handling Process Server Client B Communication Process Client A Communication Communication Process Process
  • 12. 12 Connection Handling Process Server Client B Communication Communication Process Process Client A Communication Communication Process Process
  • 13. 13 Connection Handling Process Client C Communication Process Server Client B Communication Communication Process Process Client A Communication Communication Process Process
  • 14. 14 Connection Handling Process Client C Communication Communication Process Process Server Client B Communication Communication Process Process Client A Communication Communication Process Process
  • 15. 15 Client Socket So cketS tream! 1.  Connect to a server 2.  Send a String 3.  Receive a String 4.  Close
  • 16. 16 Server for Tests Serve Unix! echo "Smalltalk" | nc –lk 12345 Multiple Port connections number
  • 17. 17 |stream| stream := SocketStream openConnectionToHostNamed: 'localhost' port: 12345. [ stream sendCommand: 'Pharo’. Transcript cr; show: (stream nextLineLf). ] ensure: [ stream close]
  • 18. 18 Simplest Possible Server 1.  Listen on some port 2.  Accept 1 single client connection 3.  Send a String 4.  Receive a String 5.  Close
  • 19. 19 Client for Tests Host Unix! echo "Smalltalk" | nc localhost 12345 Port number
  • 20. 20 connectionSock := Socket newTCP. [ connectionSock listenOn: 12345 backlogSize: 10. interactSock := connectionSock waitForAcceptFor: 30. stream := SocketStream on: interactSock. stream sendCommand: 'Pharo Server!’. Transcript cr; show: stream nextLineLf. ] ensure: [ connectionSock closeAndDestroy. stream close.]
  • 21. 21 Tw itter Luc: I’m struggling with the robots ---------- Noury: Which robots? WifiBots or Robulabs? ---------- like Luc: I need to setup the internal board of Robulab #2 ----------
  • 22. 22 Multi-threaded Server 1 process for connections 1 process for each client Sycnrhonization is needed
  • 23. 23 Multi-threaded fork Server 1 process for connections 1 process for each client Mutex Sycnrhonization is needed critical:
  • 24. 24 Socket 10110101 Socket 1 2 Network
  • 25. 25 Copying an object ! 10@34 10@34 110101 1011 Socket 10110101 Socket 1 2 Network
  • 26. 26 ReferenceStream streamed Represen tationOf: 1 0@34
  • 27. 27 Classes should be on both sides
  • 29. 29 proxy dispatcher Socket Socket 1 10110101 2 Network
  • 30. 30 id3 id1 proxy dispatcher id1 Socket Socket 1 10110101 2 Network
  • 32. 32 Code Proxy Deployment Message (De-)Serializing passing control Messages Argument Garbage passing Collection? by reference
  • 33. 33 Proxy Message passing control doesNotUnderstand:
  • 34. 34 ReferenceStream unStream: aString (De-)Serializing Messages streamedRepresentationOf: anObject
  • 35. 35 What OCEAN Next? New Socket Library Distributed- Objects (rST)
  • 37. Current network library ByteArray TCP+ IPv4 UDP+… +IPv6 Socket SocketAdress irty! HTTPSocket SocksSocket D 0% t ested
  • 38. OCEAN Library Socket networkLibrary NetworkLibraryProxyFactory socketID WindowsLibrary MacOSLibrary TcpSocket UdpSocket LinuxLibrary OOP 100% tested NetworkingPlugin WrapperLibrary
  • 39. OCEAN Library Lates t ers io n Socket v networkLibrary NetworkLibraryProxyFactory socketID WindowsLibrary MacOSLibrary TcpSocket UdpSocket LinuxLibrary 100% Pharo OOP 1.3 tested NetworkingPlugin WrapperLibrary
  • 40. OCEAN for Pharo 1.3 ALL Primitives ! Image Socket Plugin Library Wrapper VM Socket Plugin OS Network API
  • 41. OCEAN for Pharo 1.4? Posix Image Socket Library Library Wrapper VM Smalltalk FFI OOP IDE Plugin OS Posix Library
  • 42. OCEAN + FFI + Posix 350 300 250 200 Ocean ms 150 OldSocket 100 50 0 Receive 10MB Send 10MB
  • 43. Generalization Image Library Library Library A B Z VM FFI Smaller VM Other OS API α API β API ψ
  • 44. 44