{"id":18006990,"url":"https://github.com/yne/rle","last_synced_at":"2025-06-30T08:08:37.365Z","repository":{"id":72082228,"uuid":"55190143","full_name":"yne/rle","owner":"yne","description":"ETSI TS 103 179 Implementation of the Return Link Encapsulation","archived":false,"fork":false,"pushed_at":"2016-12-16T20:19:20.000Z","size":34,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-30T08:08:34.297Z","etag":null,"topics":["dvb-rcs2","protocol","rle"],"latest_commit_sha":null,"homepage":"http://www.etsi.org/deliver/etsi_ts/103100_103199/103179/01.01.01_60/ts_103179v010101p.pdf","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-31T23:40:19.000Z","updated_at":"2025-03-22T09:38:29.000Z","dependencies_parsed_at":"2023-07-09T22:46:06.638Z","dependency_job_id":null,"html_url":"https://github.com/yne/rle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yne/rle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Frle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Frle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Frle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Frle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yne","download_url":"https://codeload.github.com/yne/rle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Frle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262736610,"owners_count":23356148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dvb-rcs2","protocol","rle"],"created_at":"2024-10-30T01:11:33.870Z","updated_at":"2025-06-30T08:08:37.343Z","avatar_url":"https://github.com/yne.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RLE [![Build Status](https://api.travis-ci.org/yne/rle.svg)](https://travis-ci.org/yne/rle) [![Coverage](https://codecov.io/github/yne/rle/coverage.svg?branch=master)](https://codecov.io/github/yne/rle?branch=master)\r\nReturn Link Encapsulation protocol provide a flexible, bandwidth efficient transport protocol for DVB-RCS2 based satellite network.\r\n\r\n# Principe\r\nTo abstract transmitted payload from the physical limitation, RLE use 4 layers:\r\n\r\n- Service Data Unit (SDU) : contain the higher level payload (IP, Ethernet, Vlan).\r\n- Addressed Link PDU (ALPDU) : contain the SDU and it meta data (protocol pype, label, protection).\r\n- Payload-adapted PDU (PPDU) : use to adapt each variable-sized ALPDU into the fixed-sized physical layer frames.\r\n- Frame PDU (FPDU) : The physical frame that transit through the satellite link. \r\n\r\n```\r\n                  ┌─SDU1──┐       ┌───SDU2────┐       ┌──SDU3───┐\r\n      ↓           │       │       │           │       │         │      ↑\r\n                  └───────┘       └───────────┘       └─────────┘ \r\n Encapsulation                                                  Decapsulation\r\n                ┌──ALPDU1─┐   ┌──────ALPDU2───────┐   ┌─ALPDU3──┐       \r\n      ↓         │P│ SDU1  │   │P│L│   SDU2    │Pro│   │  SDU3   │      ↑\r\n                └─────────┘   └───────────────────┘   └─────────┘       \r\n Fragmentation                                                     Reassembly\r\n              ┌─────PPDU1─┐ ┌──PPDU2──┐ ┌──PPDU3──┐ ┌──PPDU4────┐\r\n      ↓       │F│  ALPDU1 │ │S│    ALP│ │E│DU2    │ │F│ ALPDU3  │      ↑\r\n              └───────────┘ └─────────┘ └─────────┘ └───────────┘    Frame\r\n Frame Packing                                                     Unpacking\r\n           ...──┬───FPDU1───┬───FPDU2───┬───FPDU3───┬───FPDU4───┌──...\r\n      ↓         │   PPDU1   │  PPDU2  │X│  PPDU3  │X│  PPDU4    │      ↑\r\n           ...──┴───────────┴───────────┴───────────┴───────────┴──...\r\n\r\n  P: Protocol Type\r\n  L: Label\r\nPro: Protection Field\r\n  F: Full fragment header\r\n  S: Start fragment header\r\n  C: Continuation fragment header\r\n  E: End fragment header\r\n  X: User defined FPDU footer  \r\n```\r\n\r\n# Features\r\n\r\n## Memory and `memcpy` efficient\r\nThe de/encapsulation process goes through 4 different layers.\r\nA naive approach would create a buffer for every layer, which imply having to memcpy the old buffer into the new one at least 3 times.\r\nA smarter approach would :\r\n- let the user, directly fill the ALPU \"data\" field (without realizing it), then, simply add the ALPDU header/footer around that to get an ALPDU.\r\n- let the user provide the FPDU location because he know, more than us, how to handle it memory allocation. \r\n- write each fragment of our freshly generated ALPDU into this FPDU, using PPDU header signaling.\r\n\r\n## Log agnostic\r\nSometimes, status code are not enough to get detailed informations about what is going on.\r\nReports are provided through user given log handler (syslog, printf, send).\r\nEach message is associated with a level (CRI,ERR,WRN,NFO,DBG) allowing the handler to filter out unwanted reports.\r\n\r\n## Stream oriented API\r\nThe de/encapsulation function use an event based API :\r\n\r\n```\r\nint rle_encap(rle_profile*, rle_sdu_iterator, rle_fpdu_iterator);\r\nint rle_decap(rle_profile*, rle_fpdu_iterator, rle_sdu_iterator);\r\n```\r\n\r\nIterators callbacks must handle they own memory re-allocation but most of time none are needed since they are just send()/recv() datas.\r\nThis allocation abstraction remove bunch of unnecessary problematics.\r\nThe `rle_decap`/`rle_encap` functions will {de,en}capsulate {SDU/FPDU}s into {FPDU/SDU}s until one of them run out because of an end of stream or end of process reason.\r\n\r\n# Benchmarks (AMD E-350 @ 1.6 Ghz)\r\n\r\n- small SDU (4B) encapsulation (worst case)\r\n  500.000 SDU/s 6.993 fpdu/s (~4MiB/s)\r\n\r\n- small SDU decapsulation\r\n  TODO\r\n\r\n# TODO list / Limitation\r\n\r\n- API to specify a per-fpdu label (could be through callback)\r\n- packet loss handling (invalid CRC / bad sequence number)\r\n- per-fragid reassembly context\r\n\r\n# Build\r\n\r\n## The library\r\n\r\n```\r\ncc -c rle.c\r\nar rcs librle.a rle.o\r\n```\r\n## Units tests \r\n\r\n```\r\ncc tests.c\r\n./a.out\r\n```\r\n\r\n## Examples\r\n\r\n```\r\ncc -L. -lrle example.c -o ex\r\nyes sir| ex -s20 -f50 -t100 e | ex -s20 -f50 d\r\n```\r\n\r\n# Documentation\r\n\r\nSee [ETSI TS 103 179](http://www.etsi.org/deliver/etsi_ts/103100_103199/103179/01.01.01_60/ts_103179v010101p.pdf) for the full RLE specification.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyne%2Frle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyne%2Frle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyne%2Frle/lists"}