Simple, Scalable and Secure Networking for Data Centers with Project Calico
Nanomsg - Scalable Networking Library
-
Upload
hamidreza-soleimani -
Category
Technology
-
view
251 -
download
6
Transcript of Nanomsg - Scalable Networking Library
![Page 1: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/1.jpg)
NanomsgScalable Networking Library
Hamidreza Soleimani CTO @ BisPhone Technologies
Tehran Linux User Group August 11, 2016
![Page 2: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/2.jpg)
– Characteristics of Scalability on Performance - André B. Bondi
“Scalability is the capability of a Process, OS or Network to handle a growing amount of work, or its
potential to be enlarged in order to accommodate that growth.”
Scalability
![Page 3: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/3.jpg)
OS —————
In-Process Transport
Inter-Process Transport
TCP Transport
Network —————
Process —————
Thread 1
Thread 2
Process1
Process 2
Node 1
Node 2
![Page 4: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/4.jpg)
Log Aggregator
Global Service Registry
Metric Collector
Monitoring Service
Clients Load Balancers
Data Access Layer
Databases
Request Handlers
Push Notification
Services
etc.
etc.
![Page 5: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/5.jpg)
Nanomsg provides the “Lego bricks” for building scalable and distributed
systems
![Page 6: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/6.jpg)
– Distributed Systems: Concepts and Design (5th Edition) - Addison Wesley
“A distributed system is a model in which components located on networked computers communicate and coordinate their actions by
passing messages.”
Distributed Systems
![Page 7: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/7.jpg)
Nanomsg is all about communication and coordination
![Page 8: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/8.jpg)
OS —————
In-Process Transport
Inter-Process Transport
TCP Transport
Network —————
Process —————
Thread 1
Thread 2
Process1
Process 2
Node 1
Node 2
socket.bind('inproc://…') socket.bind('ipc://…') socket.bind('tcp://…')
![Page 9: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/9.jpg)
Log Aggregator
Global Service Registry
Metric Collector
Monitoring Service
Clients Load Balancers
Data Access Layer
Databases
Request Handlers
Push Notification
Services
etc.
etc.
![Page 10: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/10.jpg)
Nanomsg is written in C with binding for
almost all languages C++
ErlangClojure
D
HaskellGoFortran Dylan
C#
Javascript
Java
Objective-C
R
Ruby
Python PHP
Lisp
Rust
OCamlSmalltalk
![Page 11: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/11.jpg)
Nanomsg API is POSIX-compliant
![Page 12: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/12.jpg)
Nanomsg Scalability Protocols
PAIRREQ/REP
PUB/SUBBUS
SURVEY
PIPELINE
![Page 13: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/13.jpg)
PAIR Bidirectional Communication
Socket 1 Socket 2
![Page 14: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/14.jpg)
REQ/REP Client Requests, Server Replies
Server Client
![Page 15: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/15.jpg)
Publisher Subscriber
PUB/SUB Topic Broadcasting
![Page 16: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/16.jpg)
PIPELINE One-Way Data-flow
BUS Many-to-Many Communication
SURVEY Ask Group a Question
Producer ConsumerConsumer / Producer
Node 1
Node 3
Node 2
Node 4
Surveyor RespondentRespondent
![Page 17: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/17.jpg)
Example
Github.com/hamidreza-s/NanoChat
![Page 18: Nanomsg - Scalable Networking Library](https://reader033.fdocuments.net/reader033/viewer/2022042723/5883dff21a28ab62358b629b/html5/thumbnails/18.jpg)
Question?
hamidreza-s.github.io