were laid beginning in the 1850s and carried telegraphy traffic, establishing the first instant telecommunications links between continents, such as the first transatlantic telegraph cable which became operational on 16 August 1858. 7
two or more entities of a communications system to transmit information via any variation of a physical quantity.” https://en.wikipedia.org/wiki/Communication_protocol 12
데이터를 전송하기 위해 설계된 애플리케이션 계층 프로토콜 • OSI 모델의 최상위 계층인 애플리케이션 계층에서 작동 • 클라이언트(예: 웹 브라우저)가 서버에 요청을 보내고, 서버가 응답을 반환하는 요청/응답 모델을 사용 • 데이터는 일반적으로 텍스트 기반(예: HTML, JSON, XML) 형식으로 전송 16
for every new request, we need to create a new connection from the client to the server. Head-of-line blocking (HOL blocking) in computer networking is a performance-limiting phenomenon that occurs when a queue of packets is held up by the first packet in the queue. Connectionless Head Of Line Blocking(HOLB) 17
Blocking(HOLB) • One form of HOL blocking in HTTP/1.1 is when the number of allowed parallel requests in the browser is used up, and subsequent requests need to wait for the former ones to complete. • HTTP/2 addresses this issue through request multiplexing, which eliminates HOL blocking at the application layer, but HOL still exists at the transport (TCP) layer 18
메서드)를 호출하는 방식으로, 클라이언트가 서버의 함수를 로컬에서 호출하는 것처럼 사용 가능 • 네트워크를 통해 다른 컴퓨터에 있는 프로그램과 상호 작용할 수 있게 해주는 방법 • 다양한 프로토콜과 데이터 형식(JSON, XML 등)을 사용할 수 있음. 그러나 텍스트 기반으로 크기가 상대적으로 큼 • 기본적으로 HTTP, TCP 등 다양한 전송 프로토콜을 사용할 수 있음 • 다양한 언어 및 플랫폼 언어 지원 • Interface Description Language
framework. • gRPC was initially created by Google, which used a single general-purpose RPC infrastructure called Stubby to connect the large number of microservices running within and across its data centers from about 2001. • Core features that make it awesome ◦ Idiomatic client libraries in 11 languages ◦ Highly efficient on wire and with a simple service definition framework ◦ Bi-directional streaming with http/2 based transport ◦ Pluggable auth, tracing, load balancing and health checking • Initial release: August 2016 (7 years ago)
성능과 효율성을 개선한 형태 • HTTP/2를 기반으로 하며 프로토콜 버퍼(Protocol Buffer)를 데이터 직렬화 형식으로 사용 ◦ HTTP/2를 사용하여 멀티플렉싱, 서버 푸시, 흐름 제어 등을 지원 ◦ Protocol Buffers를 사용하여 데이터를 이진 형식으로 직렬화 • 마이크로서비스 아키텍처, 클라우드 네이티브 애플리케이션, 고성능 시스템 통신 등에 널리 사용
extensible mechanism for serializing structured data. • Protocol buffers are a combination of the definition language (created in .proto files), the code that the proto compiler generates to interface with data,
possible states: ◦ the field is set, and contains a value that was explicitly set or parsed from the wire. It will be serialized to the wire. ◦ the field is unset, and will return the default value. It will not be serialized to the wire. ◦ You can check to see if the value was explicitly set. • repeated: this field type can be repeated zero or more times in a well-formed message. The order of the repeated values will be preserved. • map: this is a paired key/value field type. Specifying Field Labels 37
id = 1; } 0x08 0x01 id의 값이 1인 경우 인코딩 0x08 field_tag=(field_number<<3) ∣ wire_type Field Tag Value Encode Field Tag ID Name Used For 0 VARINT int32, int64, uint32, uint64, sint32, sint64, bool, enum 1 I64 fixed64, sfixed64, double 2 LEN string, bytes, embedded messages, packed repeated fields 3 SGROUP group start (deprecated) 4 EGROUP group end (deprecated) 5 I32 fixed32, sfixed32, float wire_type field_tag Value
id = 1; } 0x08 0x01 id의 값이 1인 경우 인코딩 0x08 field_tag=(field_number<<3) ∣ wire_type field_tag=(1 << 3) ∣ 0 = 8 1. 0000 0001 (field_number) 2. 0000 1000 (field_number<<3) 3. 0000 1000 | 0 (wire_type) ⇒ 0x08 Field Tag Value Encode Field Tag field_tag Value field_tag
name = 1; } 문자열 "io extended"를 UTF-8로 인코딩 방법 i = 0x69 o = 0x6F (공백) = 0x20 e = 0x65 x = 0x78 t = 0x74 e = 0x65 n = 0x6E d = 0x64 e = 0x65 d = 0x64 Value
codecs: const [ GzipCodec(), IdentityCodec(), ], ), ); await server.serve(port: 50051); print('Server listening on port ${server.port}...'); 67 Server Side
codecs: const [ GzipCodec(), IdentityCodec(), ], ), ); await server.serve(port: 50051); print('Server listening on port ${server.port}...'); 68 Server Side
sendData(ServiceCall call, Data request) async { ref?.read(treadmillNotifierProvider.notifier).update(request); return Reply(message: request.toString()); } } 76 Server Side
sendData(ServiceCall call, Data request) async { ref?.read(treadmillNotifierProvider.notifier).update(request); return Reply(message: request.toString()); } } 77 Server Side