`
Rukawa
  • 浏览: 2193 次
  • 性别: Icon_minigender_1
  • 来自: 天津
最近访客 更多访客>>
社区版块
存档分类
最新评论

why we need a bi-layer protocol

    博客分类:
  • java
阅读更多
In industrial grade, the network communication protocol is usually designed to be divided into two layers: the higher layer and the lower layer.



The most outstanding difference is the higher packets employing a variable length while the lower doing a fixed length. The higher relates to business logic, whose packet length is ranging, say, from 1x KB to 1xx MB.

Why we need a fixed-size lower layer?

Imagine the following scenario: an emergency packet needs to be send immediately but a low-priority packet is in the process of being sent, which has occupied the expensive socket and would last for a while. Without the lower layer, we can do nothing but to wait.

It comes to a help that segmenting the size-variable packet into small fixed-size sub-packets, whereby we can check whether there’s an additional packet with higher priority at the interval of sending two sub-packets.

Abbreviations:
MUX – Multiplexing,
DEMUX - Demultiplexing

An alternate solution - FTP’s way:
FTP server and FTP client maintain two socket connections:
1) Command connection – for short and high-prioritized packets
2) Data connection – for long and low-prioritized packets

  • 大小: 13.3 KB
  • 大小: 5.1 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics