lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

October 2024

  • 1 participants
  • 1631 discussions
[M] Change in libosmo-sigtran[master]: sua, sccp: Add APIs to get cause string description
by pespin 25 Oct '24

25 Oct '24
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38550?usp=email ) Change subject: sua, sccp: Add APIs to get cause string description ...................................................................... sua, sccp: Add APIs to get cause string description Change-Id: I2c38b2d8104e728dda234c36ea284266b4c55ab1 --- M TODO-RELEASE M include/osmocom/sccp/sccp_types.h M include/osmocom/sigtran/protocol/sua.h M src/sccp_types.c M src/sua.c 5 files changed, 166 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/50/38550/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38550?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I2c38b2d8104e728dda234c36ea284266b4c55ab1 Gerrit-Change-Number: 38550 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder
1 0
0 0
[M] Change in libosmo-sigtran[master]: WIP: Add APIs to log cause
by pespin 25 Oct '24

25 Oct '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38550?usp=email ) Change subject: WIP: Add APIs to log cause ...................................................................... WIP: Add APIs to log cause Change-Id: I2c38b2d8104e728dda234c36ea284266b4c55ab1 --- M TODO-RELEASE M include/osmocom/sccp/sccp_types.h M include/osmocom/sigtran/protocol/sua.h M src/sccp_types.c M src/sua.c 5 files changed, 166 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/50/38550/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 935cda8..6d8cb80 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmo-sigtran API change struct osmo_ss7_instance has new member 'secondary_pc' +libosmo-sigtran add API osmo_sccp_{release,return,reset,error,refusal}_cause_name(s), osmo_sua_sccp_cause_name diff --git a/include/osmocom/sccp/sccp_types.h b/include/osmocom/sccp/sccp_types.h index bc11258..5be0392 100644 --- a/include/osmocom/sccp/sccp_types.h +++ b/include/osmocom/sccp/sccp_types.h @@ -209,6 +209,9 @@ SCCP_RELEASE_CAUSE_UNQUALIFIED = 15, SCCP_RELEASE_CAUSE_SCCP_FAILURE = 16, }; +extern const struct value_string osmo_sccp_release_cause_names[]; +static inline const char *osmo_sccp_release_cause_name(enum sccp_release_cause val) +{ return get_value_string(osmo_sccp_release_cause_names, val); } /* ITU-T Q.713, Section 3.12 Return cause */ enum sccp_return_cause { @@ -228,6 +231,9 @@ SCCP_RETURN_CAUSE_SEGMENTATION_NOT_SUPPORTED= 13, SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE = 14 }; +extern const struct value_string osmo_sccp_return_cause_names[]; +static inline const char *osmo_sccp_return_cause_name(enum sccp_return_cause val) +{ return get_value_string(osmo_sccp_return_cause_names, val); } /* ITU-T Q.713, Section 3.13 Reset cause */ enum sccp_reset_cause { @@ -243,7 +249,11 @@ SCCP_RESET_CAUSE_ACCESS_OPERATIONAL = 9, SCCP_RESET_CAUSE_NETWORK_CONGESTION = 10, SCCP_RESET_CAUSE_RESERVED = 11, + SCCP_RESET_CAUSE_UNQUALIFIED = 12, }; +extern const struct value_string osmo_sccp_reset_cause_names[]; +static inline const char *osmo_sccp_reset_cause_name(enum sccp_reset_cause val) +{ return get_value_string(osmo_sccp_reset_cause_names, val); } /* ITU-T Q.713, Section 3.14 Error cause */ enum sccp_error_cause { @@ -253,6 +263,9 @@ SCCP_ERROR_SERVICE_CLASS_MISMATCH = 3, SCCP_ERROR_UNQUALIFIED = 4, }; +extern const struct value_string osmo_sccp_error_cause_names[]; +static inline const char *osmo_sccp_error_cause_name(enum sccp_error_cause val) +{ return get_value_string(osmo_sccp_error_cause_names, val); } /* ITU-T Q.713 Section 3.15 Refusal cause */ enum sccp_refusal_cause { @@ -277,6 +290,9 @@ SCCP_REFUSAL_NO_TRANS_FOR_ADDRESS_NATURE = 18, SCCP_REFUSAL_UNEQUIPPED_USER = 19, }; +extern const struct value_string osmo_sccp_refusal_cause_names[]; +static inline const char *osmo_sccp_refusal_cause_name(enum sccp_refusal_cause val) +{ return get_value_string(osmo_sccp_refusal_cause_names, val); } /* * messages... as of Q.713 Chapter 4 diff --git a/include/osmocom/sigtran/protocol/sua.h b/include/osmocom/sigtran/protocol/sua.h index 4ce88f9..6fed2bc 100644 --- a/include/osmocom/sigtran/protocol/sua.h +++ b/include/osmocom/sigtran/protocol/sua.h @@ -19,6 +19,7 @@ */ #pragma once +#include <stddef.h> #include <stdint.h> #include <osmocom/sigtran/protocol/m3ua.h> @@ -138,6 +139,8 @@ #define SUA_CAUSE_T_RESET 0x0400 #define SUA_CAUSE_T_ERROR 0x0500 +const char *osmo_sua_sccp_cause_name(uint32_t sccp_cause, char *out_buf, size_t out_buf_len); + /* 3.9.12 Error: Identical to M3UA, extended by two at the bottom */ #define SUA_ERR_INVALID_VERSION M3UA_ERR_INVALID_VERSION #define SUA_ERR_UNSUPP_MSG_CLASS M3UA_ERR_UNSUPP_MSG_CLASS diff --git a/src/sccp_types.c b/src/sccp_types.c index 98b3fa4..a923aa2 100644 --- a/src/sccp_types.c +++ b/src/sccp_types.c @@ -49,3 +49,98 @@ { SCCP_PNC_LONG_DATA, "Long data" }, {} }; + +/* ITU-T Q.713, Section 3.11 Release cause */ +const struct value_string osmo_sccp_release_cause_names[] = { + { SCCP_RELEASE_CAUSE_END_USER_ORIGINATED, "end user originated" }, + { SCCP_RELEASE_CAUSE_END_USER_CONGESTION, "end user congestion" }, + { SCCP_RELEASE_CAUSE_END_USER_FAILURE, "end user failure" }, + { SCCP_RELEASE_CAUSE_SCCP_USER_ORIGINATED, "SCCP user originated" }, + { SCCP_RELEASE_CAUSE_REMOTE_PROCEDURE_ERROR, "remote procedure error" }, + { SCCP_RELEASE_CAUSE_INCONSISTENT_CONN_DATA, "inconsistent connection data" }, + { SCCP_RELEASE_CAUSE_ACCESS_FAILURE, "access failure" }, + { SCCP_RELEASE_CAUSE_ACCESS_CONGESTION, "access congestion" }, + { SCCP_RELEASE_CAUSE_SUBSYSTEM_FAILURE, "subsystem failure" }, + { SCCP_RELEASE_CAUSE_SUBSYSTEM_CONGESTION, "subsystem congestion" }, + { SCCP_RELEASE_CAUSE_MTP_FAILURE, "MTP failure" }, + { SCCP_RELEASE_CAUSE_NETWORK_CONGESTION, "network congestion" }, + { SCCP_RELEASE_CAUSE_EXPIRATION_RESET, "expiration of reset timer" }, + { SCCP_RELEASE_CAUSE_EXPIRATION_INACTIVE, "expiration of receive inactivity timer" }, + { SCCP_RELEASE_CAUSE_RESERVED, "reserved" }, + { SCCP_RELEASE_CAUSE_UNQUALIFIED, "unqualified" }, + { SCCP_RELEASE_CAUSE_SCCP_FAILURE, "SCCP failure" }, + {} +}; + +/* ITU-T Q.713, Section 3.12 Return cause */ +const struct value_string osmo_sccp_return_cause_names[] = { + { SCCP_RETURN_CAUSE_NO_TRANSLATION_NATURE, "no translation for an address of such nature" }, + { SCCP_RETURN_CAUSE_NO_TRANSLATION, "no translation for this specific address" }, + { SCCP_RETURN_CAUSE_SUBSYSTEM_CONGESTION, "subsystem congestion" }, + { SCCP_RETURN_CAUSE_SUBSYSTEM_FAILURE, "subsystem failure" }, + { SCCP_RETURN_CAUSE_UNEQUIPPED_USER, "unequipped user" }, + { SCCP_RETURN_CAUSE_MTP_FAILURE, "MTP failure" }, + { SCCP_RETURN_CAUSE_NETWORK_CONGESTION, "network congestion" }, + { SCCP_RETURN_CAUSE_UNQUALIFIED, "unqualified" }, + { SCCP_RETURN_CAUSE_ERROR_IN_MSG_TRANSPORT, "error in message transport" }, + { SCCP_RETURN_CAUSE_ERROR_IN_LOCAL_PROCESSING, "error in local processing" }, + { SCCP_RETURN_CAUSE_DEST_CANNOT_PERFORM_REASSEMBLY, "destination cannot perform reassembly" }, + { SCCP_RETURN_CAUSE_SCCP_FAILURE, "SCCP failure" }, + { SCCP_RETURN_CAUSE_HOP_COUNTER_VIOLATION, "hop counter violation" }, + { SCCP_RETURN_CAUSE_SEGMENTATION_NOT_SUPPORTED, "segmentation not supported" }, + { SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE, "segmentation failure" }, + {} +}; + +/* ITU-T Q.713, Section 3.13 Reset cause */ +const struct value_string osmo_sccp_reset_cause_names[] = { + { SCCP_RESET_CAUSE_END_USER_ORIGINATED, "end user originated" }, + { SCCP_RESET_CAUSE_SCCP_USER_ORIGINATED, "SCCP user originated" }, + { SCCP_RESET_CAUSE_MSG_OUT_OF_ORDER_PS, "message out of order - incorrect P(S)" }, + { SCCP_RESET_CAUSE_MSG_OUT_OF_ORDER_PR, "message out of order - incorrect P(R)" }, + { SCCP_RESET_CAUSE_RPC_OUT_OF_WINDOW, "remote procedure error - message out of window" }, + { SCCP_RESET_CAUSE_RPC_INCORRECT_PS, "remote procedure error - incorrect P(S) after (re)initialization" }, + { SCCP_RESET_CAUSE_RPC_GENERAL, "remote procedure error - general" }, + { SCCP_RESET_CAUSE_REMOTE_END_USER_OPERATIONAL, "remote end user operational" }, + { SCCP_RESET_CAUSE_NETWORK_OPERATIONAL, "network operational" }, + { SCCP_RESET_CAUSE_ACCESS_OPERATIONAL, "access operational" }, + { SCCP_RESET_CAUSE_NETWORK_CONGESTION, "network congestion" }, + { SCCP_RESET_CAUSE_RESERVED, "reserved" }, + { SCCP_RESET_CAUSE_UNQUALIFIED, "unqualified"}, + {} +}; + +/* ITU-T Q.713, Section 3.14 Error cause */ +const struct value_string osmo_sccp_error_cause_names[] = { + { SCCP_ERROR_LRN_MISMATCH_UNASSIGNED, "local reference number (LRN) mismatch - unassigned destination LRN" }, + { SCCP_ERROR_LRN_MISMATCH_INCONSISTENT, "local reference number (LRN) mismatch - inconsistent source LRN" }, + { SCCP_ERROR_POINT_CODE_MISMATCH, "point code mismatch" }, + { SCCP_ERROR_SERVICE_CLASS_MISMATCH, "service class mismatch" }, + { SCCP_ERROR_UNQUALIFIED, "unqualified" }, + {} +}; + +/* ITU-T Q.713 Section 3.15 Refusal cause */ +const struct value_string osmo_sccp_refusal_cause_names[] = { + { SCCP_REFUSAL_END_USER_ORIGINATED, "end user originated" }, + { SCCP_REFUSAL_END_USER_CONGESTION, "end user congestion" }, + { SCCP_REFUSAL_END_USER_FAILURE, "end user failure" }, + { SCCP_REFUSAL_SCCP_USER_ORIGINATED, "SCCP user originated" }, + { SCCP_REFUSAL_DESTINATION_ADDRESS_UKNOWN, "destination address unknown" }, + { SCCP_REFUSAL_DESTINATION_INACCESSIBLE, "destination inaccessible" }, + { SCCP_REFUSAL_NET_QOS_NON_TRANSIENT, "network resource - QoS not available/non-transient" }, + { SCCP_REFUSAL_NET_QOS_TRANSIENT, "network resource - QoS not available/transient" }, + { SCCP_REFUSAL_ACCESS_FAILURE, "access failure" }, + { SCCP_REFUSAL_ACCESS_CONGESTION, "access congestion" }, + { SCCP_REFUSAL_SUBSYSTEM_FAILURE, "subsystem failure" }, + { SCCP_REFUSAL_SUBSYTEM_CONGESTION, "subsystem congestion" }, + { SCCP_REFUSAL_EXPIRATION, "expiration of the connection establishment timer" }, + { SCCP_REFUSAL_INCOMPATIBLE_USER_DATA, "incompatible user data" }, + { SCCP_REFUSAL_RESERVED, "reserved" }, + { SCCP_REFUSAL_UNQUALIFIED, "unqualified" }, + { SCCP_REFUSAL_HOP_COUNTER_VIOLATION, "hop counter violation" }, + { SCCP_REFUSAL_SCCP_FAILURE, "SCCP failure" }, + { SCCP_REFUSAL_NO_TRANS_FOR_ADDRESS_NATURE, "no translation for an address of such nature" }, + { SCCP_REFUSAL_UNEQUIPPED_USER, "unequipped user" }, + {} +}; diff --git a/src/sua.c b/src/sua.c index 2753cfe..d8eb9e5 100644 --- a/src/sua.c +++ b/src/sua.c @@ -41,6 +41,7 @@ #include <osmocom/sigtran/protocol/sua.h> #include <osmocom/sigtran/protocol/m3ua.h> #include <osmocom/sigtran/osmo_ss7.h> +#include <osmocom/sccp/sccp_types.h> #include "xua_as_fsm.h" #include "xua_asp_fsm.h" @@ -1008,3 +1009,53 @@ return SUA_ERR_UNSUPP_MSG_CLASS; } } + +/* RFC 3868 3.10.6. SCCP Cause */ +const struct value_string sua_cause_type_names[] = { + { SUA_CAUSE_T_RETURN, "Return Cause" }, + { SUA_CAUSE_T_REFUSAL, "Refusal Cause" }, + { SUA_CAUSE_T_RELEASE, "Release Cause" }, + { SUA_CAUSE_T_RESET, "Reset Cause" }, + { SUA_CAUSE_T_ERROR, "Error Cause" }, + {} +}; +const char *osmo_sua_sccp_cause_name(uint32_t sccp_cause, char *out_buf, size_t out_buf_len) +{ + uint16_t cause_type = sccp_cause & SUA_CAUSE_T_MASK; + uint8_t cause_val = sccp_cause & 0xff; + const char *cause_type_str = get_value_string_or_null(sua_cause_type_names, cause_type); + const char *cause_str = NULL; + + if (!out_buf || out_buf_len == 0) + return NULL; + + if (!cause_type_str) + goto ret_unknown_cause_type; + + switch (cause_type) { + case SUA_CAUSE_T_RETURN: + cause_str = osmo_sccp_return_cause_name(cause_val); + break; + case SUA_CAUSE_T_REFUSAL: + cause_str = osmo_sccp_refusal_cause_name(cause_val); + break; + case SUA_CAUSE_T_RELEASE: + cause_str = osmo_sccp_release_cause_name(cause_val); + break; + case SUA_CAUSE_T_RESET: + cause_str = osmo_sccp_reset_cause_name(cause_val); + break; + case SUA_CAUSE_T_ERROR: + cause_str = osmo_sccp_error_cause_name(cause_val); + break; + default: + goto ret_unknown_cause_type; + } + + snprintf(out_buf, out_buf_len, "%s <%s>", cause_type_str, cause_str); + return out_buf; + +ret_unknown_cause_type: + snprintf(out_buf, out_buf_len, "Unknown SUA SCCP Cause 0x%08x\n", sccp_cause); + return out_buf; +} -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38550?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I2c38b2d8104e728dda234c36ea284266b4c55ab1 Gerrit-Change-Number: 38550 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in pysim[master]: pySim.ts_31_102: Add support for EF.EARFCNList
by dexter 25 Oct '24

25 Oct '24
Attention is currently required from: laforge. dexter has uploaded a new patch set (#4) to the change originally created by laforge. ( https://gerrit.osmocom.org/c/pysim/+/38472?usp=email ) The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: pySim.ts_31_102: Add support for EF.EARFCNList ...................................................................... pySim.ts_31_102: Add support for EF.EARFCNList This adds a construct + pyosmocore.tlv based declarative encoder/decoder for the EF.EARFCNList file used in the context of NB-IoT in later release USIMs. Change-Id: I16797ca58c3ad6ebaf588d04fec011a0cbcfcef3 --- M pySim/ts_31_102.py M tests/pySim-shell_test/export/export.script.ok M tests/pySim-shell_test/file_specific/test_ef_ust.ok M tests/pySim-shell_test/fsdump/fsdump.json.ok 4 files changed, 103 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/72/38472/4 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/38472?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I16797ca58c3ad6ebaf588d04fec011a0cbcfcef3 Gerrit-Change-Number: 38472 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: sua: sua_iei_names: s/Cause/SCCP Cause/
by pespin 25 Oct '24

25 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38548?usp=email ) Change subject: sua: sua_iei_names: s/Cause/SCCP Cause/ ...................................................................... sua: sua_iei_names: s/Cause/SCCP Cause/ This is how the field is named in RFC 3868 section 3.10. This also helps identifying it from other existing field "User/Cause". Change-Id: I106baa8d181ebfa1616cdd7efab2897dd78fc8e6 --- M src/sua.c M tests/xua/xua_test.ok 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: daniel: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/src/sua.c b/src/sua.c index 3d9d7ec..2753cfe 100644 --- a/src/sua.c +++ b/src/sua.c @@ -89,7 +89,7 @@ { SUA_IEI_DEST_ADDR, "Destination Address" }, { SUA_IEI_SRC_REF, "Source Reference" }, { SUA_IEI_DEST_REF, "Destination Reference" }, - { SUA_IEI_CAUSE, "Cause" }, + { SUA_IEI_CAUSE, "SCCP Cause" }, { SUA_IEI_SEQ_NR, "Sequence Number" }, { SUA_IEI_RX_SEQ_NR, "Receive Sequence Number" }, { SUA_IEI_ASP_CAPA, "ASP Capability" }, diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok index 3072a95..9d44775 100644 --- a/tests/xua/xua_test.ok +++ b/tests/xua/xua_test.ok @@ -75,7 +75,7 @@ => BSSMAP-RELEASED SCCP Input: [L2]> 04 00 00 03 01 02 03 00 01 0f 02 23 42 00 Transcoding message SCCP -> XUA -Decoded SUA: HDR=(CO:RELRE,V=0,LEN=0), PART(T=Destination Reference,L=4,D=00000003), PART(T=Source Reference,L=4,D=00010203), PART(T=Cause,L=4,D=00000300), PART(T=Data,L=2,D=2342) +Decoded SUA: HDR=(CO:RELRE,V=0,LEN=0), PART(T=Destination Reference,L=4,D=00000003), PART(T=Source Reference,L=4,D=00010203), PART(T=SCCP Cause,L=4,D=00000300), PART(T=Data,L=2,D=2342) Re-Encoding decoded SUA to SCCP SCCP Output: [L2]> 04 00 00 03 01 02 03 00 01 0f 02 23 42 00 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38548?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I106baa8d181ebfa1616cdd7efab2897dd78fc8e6 Gerrit-Change-Number: 38548 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: cosmetic: Add some comments with spec references
by pespin 25 Oct '24

25 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38549?usp=email ) Change subject: cosmetic: Add some comments with spec references ...................................................................... cosmetic: Add some comments with spec references Change-Id: I131dca5be9313d3beb51ec9d5f507552ae6c9d84 --- M include/osmocom/sccp/sccp_types.h M include/osmocom/sigtran/protocol/sua.h 2 files changed, 6 insertions(+), 1 deletion(-) Approvals: daniel: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/include/osmocom/sccp/sccp_types.h b/include/osmocom/sccp/sccp_types.h index 17018d2..bc11258 100644 --- a/include/osmocom/sccp/sccp_types.h +++ b/include/osmocom/sccp/sccp_types.h @@ -189,6 +189,7 @@ SCCP_PROTOCOL_RETURN_MESSAGE = 8, }; +/* ITU-T Q.713, Section 3.11 Release cause */ enum sccp_release_cause { SCCP_RELEASE_CAUSE_END_USER_ORIGINATED = 0, SCCP_RELEASE_CAUSE_END_USER_CONGESTION = 1, @@ -209,6 +210,7 @@ SCCP_RELEASE_CAUSE_SCCP_FAILURE = 16, }; +/* ITU-T Q.713, Section 3.12 Return cause */ enum sccp_return_cause { SCCP_RETURN_CAUSE_NO_TRANSLATION_NATURE = 0, SCCP_RETURN_CAUSE_NO_TRANSLATION = 1, @@ -227,6 +229,7 @@ SCCP_RETURN_CAUSE_SEGMENTATION_FAILURE = 14 }; +/* ITU-T Q.713, Section 3.13 Reset cause */ enum sccp_reset_cause { SCCP_RESET_CAUSE_END_USER_ORIGINATED = 0, SCCP_RESET_CAUSE_SCCP_USER_ORIGINATED = 1, @@ -242,6 +245,7 @@ SCCP_RESET_CAUSE_RESERVED = 11, }; +/* ITU-T Q.713, Section 3.14 Error cause */ enum sccp_error_cause { SCCP_ERROR_LRN_MISMATCH_UNASSIGNED = 0, /* local reference number */ SCCP_ERROR_LRN_MISMATCH_INCONSISTENT = 1, @@ -250,7 +254,7 @@ SCCP_ERROR_UNQUALIFIED = 4, }; -/* ITU=T Q.713 Section 3.15 */ +/* ITU-T Q.713 Section 3.15 Refusal cause */ enum sccp_refusal_cause { SCCP_REFUSAL_END_USER_ORIGINATED = 0, SCCP_REFUSAL_END_USER_CONGESTION = 1, diff --git a/include/osmocom/sigtran/protocol/sua.h b/include/osmocom/sigtran/protocol/sua.h index 70c16ba..4ce88f9 100644 --- a/include/osmocom/sigtran/protocol/sua.h +++ b/include/osmocom/sigtran/protocol/sua.h @@ -130,6 +130,7 @@ #define SUA_RI_HOST 3 #define SUA_RI_SSN_IP 4 +/* 3.10.6. SCCP Cause: Cause Type */ #define SUA_CAUSE_T_MASK 0xff00 #define SUA_CAUSE_T_RETURN 0x0100 #define SUA_CAUSE_T_REFUSAL 0x0200 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38549?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I131dca5be9313d3beb51ec9d5f507552ae6c9d84 Gerrit-Change-Number: 38549 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: cosmetic: Add some comments with spec references
by daniel 25 Oct '24

25 Oct '24
Attention is currently required from: pespin. daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38549?usp=email ) Change subject: cosmetic: Add some comments with spec references ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38549?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I131dca5be9313d3beb51ec9d5f507552ae6c9d84 Gerrit-Change-Number: 38549 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 25 Oct 2024 15:53:57 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in libosmo-sigtran[master]: sua: sua_iei_names: s/Cause/SCCP Cause/
by daniel 25 Oct '24

25 Oct '24
Attention is currently required from: pespin. daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38548?usp=email ) Change subject: sua: sua_iei_names: s/Cause/SCCP Cause/ ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38548?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I106baa8d181ebfa1616cdd7efab2897dd78fc8e6 Gerrit-Change-Number: 38548 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 25 Oct 2024 15:53:28 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in pysim[master]: global_platform: ensure ArgumentParser gets a list for choices
by dexter 25 Oct '24

25 Oct '24
dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38542?usp=email ) Change subject: global_platform: ensure ArgumentParser gets a list for choices ...................................................................... global_platform: ensure ArgumentParser gets a list for choices When we use the argument parser with choices, we sometimes use a list that we derive from a dictionary. However if we do that we still must ensure that we really put a list and not a dict_values or dict_keys class as parameter because this won't work any longer with cmd2 version 2.5.0 Related: OS#6601 Change-Id: I165fefd8feb0d96cedc15d036fb32da381f711b3 --- M pySim/global_platform/__init__.py 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index e499e0f..53e13e8 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -589,7 +589,7 @@ put_key_parser.add_argument('--old-key-version-nr', type=auto_uint8, default=0, help='Old Key Version Number') put_key_parser.add_argument('--key-version-nr', type=auto_uint8, required=True, help='Key Version Number') put_key_parser.add_argument('--key-id', type=auto_uint7, required=True, help='Key Identifier (base)') - put_key_parser.add_argument('--key-type', choices=KeyType.ksymapping.values(), action='append', required=True, help='Key Type') + put_key_parser.add_argument('--key-type', choices=list(KeyType.ksymapping.values()), action='append', required=True, help='Key Type') put_key_parser.add_argument('--key-data', type=is_hexstr, action='append', required=True, help='Key Data Block') put_key_parser.add_argument('--key-check', type=is_hexstr, action='append', help='Key Check Value') put_key_parser.add_argument('--suppress-key-check', action='store_true', help='Suppress generation of Key Check Values') @@ -650,7 +650,7 @@ return data get_status_parser = argparse.ArgumentParser() - get_status_parser.add_argument('subset', choices=StatusSubset.ksymapping.values(), + get_status_parser.add_argument('subset', choices=list(StatusSubset.ksymapping.values()), help='Subset of statuses to be included in the response') get_status_parser.add_argument('--aid', type=is_hexstr, default='', help='AID Search Qualifier (search only for given AID)') @@ -685,9 +685,9 @@ return grd_list set_status_parser = argparse.ArgumentParser() - set_status_parser.add_argument('scope', choices=SetStatusScope.ksymapping.values(), + set_status_parser.add_argument('scope', choices=list(SetStatusScope.ksymapping.values()), help='Defines the scope of the requested status change') - set_status_parser.add_argument('status', choices=CLifeCycleState.ksymapping.values(), + set_status_parser.add_argument('status', choices=list(CLifeCycleState.ksymapping.values()), help='Specify the new intended status') set_status_parser.add_argument('--aid', type=is_hexstr, help='AID of the target Application or Security Domain') @@ -726,7 +726,7 @@ inst_inst_parser.add_argument('--install-parameters', type=is_hexstr, default='', help='Install Parameters') inst_inst_parser.add_argument('--privilege', action='append', dest='privileges', default=[], - choices=Privileges._construct.flags.keys(), + choices=list(Privileges._construct.flags.keys()), help='Privilege granted to newly installed Application') inst_inst_parser.add_argument('--install-token', type=is_hexstr, default='', help='Install Token (Section GPCS C.4.2/C.4.7)') -- To view, visit https://gerrit.osmocom.org/c/pysim/+/38542?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I165fefd8feb0d96cedc15d036fb32da381f711b3 Gerrit-Change-Number: 38542 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ggsn[master]: doc: Update all iptables references with nftables
by pespin 25 Oct '24

25 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/38525?usp=email ) Change subject: doc: Update all iptables references with nftables ...................................................................... doc: Update all iptables references with nftables Change-Id: I3caf316e8ccf1d757b83f7a119271084c55e018c --- M doc/examples/firewall M doc/manuals/chapters/mtu.adoc M doc/manuals/chapters/running.adoc 3 files changed, 23 insertions(+), 23 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/firewall b/doc/examples/firewall index fce735a..d5fadec 100755 --- a/doc/examples/firewall +++ b/doc/examples/firewall @@ -13,36 +13,36 @@ # to and from the Gn interface. # * Masquerede on Gi interface. -IPTABLES="/sbin/iptables" +NFT="nft" IFGN="eth0" IFGI="eth1" -$IPTABLES -P INPUT DROP -$IPTABLES -P FORWARD ACCEPT -$IPTABLES -P OUTPUT ACCEPT +$NFT add chain ip filter input '{ policy drop; }' +$NFT add chain ip filter forward '{ policy accept; }' +$NFT add chain ip filter output '{ policy accept; }' #Allow related and established on all interfaces (input) -$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +$NFT add rule ip filter input ct state related,established counter accept #Allow releated, established, GTP and ssh on $IFGN. Reject everything else. -$IPTABLES -A INPUT -i $IFGN -p tcp -m tcp --dport 22 --syn -j ACCEPT -$IPTABLES -A INPUT -i $IFGN -p udp -m udp --dport 2123 -j ACCEPT -$IPTABLES -A INPUT -i $IFGN -p udp -m udp --dport 2152 -j ACCEPT -$IPTABLES -A INPUT -i $IFGN -p udp -m udp --dport 3386 -j ACCEPT -$IPTABLES -A INPUT -i $IFGN -j REJECT +$NFT add rule ip filter input iifname $IFGN tcp dport 22 tcp flags syn / fin,syn,rst,ack counter accept +$NFT add rule ip filter input iifname $IFGN udp dport 2123 counter accept +$NFT add rule ip filter input iifname $IFGN udp dport 2152 counter accept +$NFT add rule ip filter input iifname $IFGN udp dport 3386 counter accept +$NFT add rule ip filter input iifname $IFGN counter reject #Allow related, established and ssh. Drop everything else. -$IPTABLES -A INPUT -i $IFGI -p tcp -m tcp --dport 22 --syn -j ACCEPT -$IPTABLES -A INPUT -i $IFGI -j DROP +$NFT add rule ip filter input iifname $IFGI tcp dport 22 tcp flags syn / fin,syn,rst,ack counter accept +$NFT add rule ip filter input iifname $IFGI counter drop # Masquerade everything going out on $IFGI -$IPTABLES -t nat -A POSTROUTING -o $IFGI -j MASQUERADE +$NFT add rule ip nat POSTROUTING oifname $IFGI counter masquerade #Allow everything on loopback interface. -$IPTABLES -A INPUT -i lo -j ACCEPT +$NFT add rule ip filter input iifname "lo" counter accept # Drop everything to and from $IFGN (forward) -$IPTABLES -A FORWARD -i $IFGN -j DROP -$IPTABLES -A FORWARD -o $IFGN -j DROP +$NFT add rule ip filter forward iifname $IFGN counter drop +$NFT add rule ip filter forward oifname $IFGN counter drop diff --git a/doc/manuals/chapters/mtu.adoc b/doc/manuals/chapters/mtu.adoc index 4c2064c..8b46f7c 100644 --- a/doc/manuals/chapters/mtu.adoc +++ b/doc/manuals/chapters/mtu.adoc @@ -150,13 +150,13 @@ MSS = TUNNEL_MTU - IP_HDR - TCP_HDR = 1420 - 60 - 56 = 1304 ---- -In linux, the MSS of TCP connections can be clamped using iptables: +In linux, the MSS of TCP connections can be clamped using nftables: ---- -iptables -t nat -A PREROUTING -p tcp --tcp-flags SYN,RST SYN -i apn0 -j TCPMSS --set-mss 1304 -iptables -t nat -I POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o apn0 -j TCPMSS --set-mss 1304 -ip6tables -t nat -A PREROUTING -p tcp --tcp-flags SYN,RST SYN -i apn0 -j TCPMSS --set-mss 1304 -ip6tables -t nat -I POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o apn0 -j TCPMSS --set-mss 1304 +nft 'add rule ip nat prerouting iifname "apn0" tcp flags syn / syn,rst counter tcp option maxseg size set 1304' +nft 'insert rule ip nat postrouting oifname "apn0" tcp flags syn / syn,rst counter tcp option maxseg size set 1304' +nft 'add rule ip6 nat prerouting iifname "apn0" tcp flags syn / syn,rst counter tcp option maxseg size set 1304' +nft 'insert rule ip6 nat postrouting oifname "apn0" tcp flags syn / syn,rst counter tcp option maxseg size set 1304' ---- ==== Further Reading diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc index 386b6b5..99fa11d 100644 --- a/doc/manuals/chapters/running.adoc +++ b/doc/manuals/chapters/running.adoc @@ -43,14 +43,14 @@ ---- sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" -iptables -t nat -A POSTROUTING -o '*' -j MASQUERADE +nft 'add rule ip nat postrouting oifname "\*" counter masquerade' ---- (You may want to replace `*` with the network device name, like `-o eth0`) There are various ways to enable these settings persistently, please refer to your distribution's documentation -- e.g. look for @net.ipv4.ip_forward=1@ in -@/etc/sysctl.d/@, and https://wiki.debian.org/iptables for masquerading. +@/etc/sysctl.d/@, and https://wiki.debian.org/nftables for masquerading. include::{srcdir}/chapters/mtu.adoc[] -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/38525?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: I3caf316e8ccf1d757b83f7a119271084c55e018c Gerrit-Change-Number: 38525 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ggsn[master]: doc: Document MTU features in User Manual and example config files
by pespin 25 Oct '24

25 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/38500?usp=email ) Change subject: doc: Document MTU features in User Manual and example config files ...................................................................... doc: Document MTU features in User Manual and example config files Related: OS#6298 Related: SYS#7122 Change-Id: Ib6e974b38107fe48072380f768e1881f0fc95e80 --- M doc/examples/osmo-ggsn-kernel-gtp.cfg M doc/examples/osmo-ggsn.cfg M doc/manuals/chapters/configuration.adoc A doc/manuals/chapters/mtu.adoc M doc/manuals/chapters/running.adoc 5 files changed, 200 insertions(+), 12 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/doc/examples/osmo-ggsn-kernel-gtp.cfg b/doc/examples/osmo-ggsn-kernel-gtp.cfg index bed52b9..69ab51b 100644 --- a/doc/examples/osmo-ggsn-kernel-gtp.cfg +++ b/doc/examples/osmo-ggsn-kernel-gtp.cfg @@ -44,6 +44,7 @@ gtpu-mode kernel-gtp tun-device tun4 type-support v4 + mtu default apply ip prefix dynamic 172.16.222.0/24 ip dns 0 8.8.8.8 ip dns 1 8.8.4.4 diff --git a/doc/examples/osmo-ggsn.cfg b/doc/examples/osmo-ggsn.cfg index 53cebc1..52b1034 100644 --- a/doc/examples/osmo-ggsn.cfg +++ b/doc/examples/osmo-ggsn.cfg @@ -44,6 +44,7 @@ gtpu-mode tun tun-device tun4 type-support v4 + mtu default apply ip prefix dynamic 172.16.222.0/24 ip dns 0 8.8.8.8 ip dns 1 8.8.4.4 @@ -53,6 +54,7 @@ gtpu-mode tun tun-device tun6 type-support v6 + mtu default apply ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 ipv6 dns 0 2001:4860:4860::8888 ipv6 dns 1 2001:4860:4860::8844 @@ -62,6 +64,7 @@ gtpu-mode tun tun-device tun46 type-support v4v6 + mtu default apply ip prefix dynamic 172.16.46.0/24 ip dns 0 8.8.8.8 ip dns 1 8.8.4.4 diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc index f0889d3..fc67cb2 100644 --- a/doc/manuals/chapters/configuration.adoc +++ b/doc/manuals/chapters/configuration.adoc @@ -1,3 +1,4 @@ +[[osmoggsn_configuring]] == Configuring OsmoGGSN All configuration of OsmoGGSN is performed using the VTY. For more @@ -22,6 +23,7 @@ gtpu-mode tun tun-device tun4 type-support v4 + mtu default apply ip prefix dynamic 176.16.222.0/24 ip dns 0 192.168.100.1 ip dns 1 8.8.8.8 @@ -162,18 +164,20 @@ ---- OsmoGGSN(config-ggsn-apn)# gtpu-mode tun <1> OsmoGGSN(config-ggsn-apn)# type-support v4 <2> -OsmoGGSN(config-ggsn-apn)# ip prefix dynamic 176.16.222.0/24 <3> -OsmoGGSN(config-ggsn-apn)# ip dns 0 192.168.100.1 <4> -OsmoGGSN(config-ggsn-apn)# ip dns 1 8.8.8.8 <5> -OsmoGGSN(config-ggsn-apn)# ip ifconfig 176.16.222.0/24 <6> +OsmoGGSN(config-ggsn-apn)# mtu 1420 apply <3> +OsmoGGSN(config-ggsn-apn)# ip prefix dynamic 176.16.222.0/24 <4> +OsmoGGSN(config-ggsn-apn)# ip dns 0 192.168.100.1 <5> +OsmoGGSN(config-ggsn-apn)# ip dns 1 8.8.8.8 <6> +OsmoGGSN(config-ggsn-apn)# ip ifconfig 176.16.222.0/24 <7> ---- <1> Use the userspace GTP-U handling using a TUN device <2> Support (only) IPv4 Addresses -<3> Specify the pool of dynamic IPv4 addresses to be allocated to PDP +<3> Specify MTU to announce to MS. Apply the MTU on the tunnel interface. +<4> Specify the pool of dynamic IPv4 addresses to be allocated to PDP contexts -<4> Specify the primary DNS server to be provided using IPCP/PCO -<5> Specify the secondary DNS server to be provided using IPCP/PCO -<6> Request OsmoGGSN to configure the `tun4` device network/netmask +<5> Specify the primary DNS server to be provided using IPCP/PCO +<6> Specify the secondary DNS server to be provided using IPCP/PCO +<7> Request OsmoGGSN to configure the `tun4` device network/netmask NOTE:: If you use the optional `ip ifconfig` command to set the network device address/mask, OsmoGGSN must run with root or `CAP_NET_ADMIN` @@ -271,6 +275,7 @@ ---- # ip addr add 192.168.7.1/24 dev apn0 +# ip link set mtu 1420 dev apn0 # ip link set apn0 up ---- @@ -298,13 +303,18 @@ [Match] Name=apn0 <1> +[Link] +MTUBytes=1420 <2> + [Network] -Address=192.168.7.1/24 <2> -IPMasquerade=yes <3> +Address=192.168.7.1/24 <3> +IPMasquerade=yes <4> ---- <1> The network device name, which must match the one in the apn0.netdev unit file above -<2> The local IP address configured on the device -<3> Requesting systemd to configure IP masquerading for this interface. Depending on your needs, +<2> Requesting systemd to set the MTU for this interface. The MTU of the tun + interface should be lower than regular, since it must accommodate the extra IP/UDP/GTPv1U headers. +<3> The local IP address configured on the device +<4> Requesting systemd to configure IP masquerading for this interface. Depending on your needs, You may not want this if you have proper end-to-end routing set up, and want to have transparent inbound IP access to your GPRS-attached devices. @@ -326,6 +336,7 @@ gtpu-mode tun tun-device apn0 type-support v4 + mtu 1420 ip prefix dynamic 192.168.7.0/24 ip dns 0 192.168.100.1 ip dns 1 8.8.8.8 diff --git a/doc/manuals/chapters/mtu.adoc b/doc/manuals/chapters/mtu.adoc new file mode 100644 index 0000000..4c2064c --- /dev/null +++ b/doc/manuals/chapters/mtu.adoc @@ -0,0 +1,171 @@ +=== MTU considerations + +When running OsmoGGSN, the user may want to take network Maximum Transmission +Unit (MTU) into consideration, and configure it based on network specific setup. + +Applying and announcing a proper MTU provides, for the MS employing it, reduced +transmission overhead (ie. due to IP fragmentation) and avoids potential +problems due to misconfigured nodes in the path (e.g. ICMP packet filtering). + +In OsmoGGSN, the MTU can be configured per APN through the VTY, see +<<osmoggsn_configuring>>. If told so by the config, osmo-ggsn will apply the MTU +on the APN network interface. + +==== MTU announced to MS + +The configured MTU is also announced to the MS through: + +* IPv4 APN: GTPv1C Create PDP Context Response, PCO IE "IPv4 Link MTU", 3GPP TS + 24.008 Table 10.5.154. +* IPv6 APN: ICMPv6 Routing Advertisement during IPv6 SLAAC procedure, RFC 4861. + +NOTE: It is up to the MS to request and use the link MTU size provided by the +network. Hence, providing an MTU size does not guarantee that there will be no +packets larger than the provided value. + +==== GTP-U tunnel overhead + +OsmoGGSN is encapsulating traffic over GTP-U, it means the packets being received, +encapsulated and transmitted over the tunnel get their size increased by the sum of +IP/UDP/GTPv1U headers being prepended: + +* IP: IPv4 headers can take up to 60 bytes (due to IPv4 options). IPv6 headers + can take up to 40 bytes (assuming no extension headers for IPv6 in general, + since they are uncommon). Hence, the 60 bytes of IPv4 are picked since that's + greater than the IPv4. +* UDP: The UDP header takes 8 bytes. +* GTPv1U: The GTPv1U header takes 12 bytes, assuming here no extensions headers + are used (OsmoGGSN doesn't use them). + +Hence, these headers add an overhead of up to `80`` bytes, as per the below formula: + +---- +GTPv1U_OVERHEAD = 60 + 8 + 12 = 80 bytes +---- + +==== Figuring out optimal MTU value + +There is no golden MTU value, since it really depends on the local (and remote) +networks where traffic is routed. The idea is finding out a value that: + +* Is as big as possible, to avoid need to split big chunks of data into lots of + small packets, hence affecting performance due to processing overhead: extra + headers being trnasmitted, plus processing of extra packets. +* Is small enough so that it can be transported over the lower layers of the + links involving the communication, avoiding IP fragmentation, which again hurts + performance. + +OsmoGGSN, by default, assumes that traffic is transported over an Ethernet +network, which has a standarized maximum MTU of 1500 bytes. Hence, by default it +announces an MTU of of `1420` bytes as per the following formula: + +---- +TUNNEL_MTU = ETH_MTU - GTPv1U_OVERHEAD = 1500 - 80 = 1420 bytes +---- + +Under certain networks, the base MTU may already be smaller than Ethernet's MTU +(1500 bytes), due to, for instance, existence of some sort of extra tunneling +protocol in the path, such as a VPN, ipsec, extra VLAN levels, etc. Under this +scenario, the user must take care of figuring out the new base MTU value to use +for the calculations presented above. This can be accomplished by packet +inspection (eg. `wireshark`) or with tools such as `ping`, running it with a +certain packet size and the IPv4 DF bit set, and see up to which packet size the +networks is able to forward the message. + +.Example: Test if packets of 1420 bytes can reach peer host 176.16.222.4 +---- +$ ping -M probe 176.16.222.4 -s 1420 +---- + +=== Increasing outer MTU + +Specifications at IEEE 802.3 establish that standard Ethernet has a maximum MTU +of `1500` bytes. +However, many Ethernet controllers can nowadays overcome this limit and allow +the use of so called _jumbo frames_. The _jumbo frames_ maximum MTU varies +depending on the implementation, with `9000` bytes being a commonly used limit. + +Note that using MTUs over the standarized `1500` bytes by means of _jumbo frames_ +can create interoperability problems with networks not supporting such frames +(eg. forcing of IP packet fragmentation), plus the fact that larger frames +consume more Ethernet link transmission time, causing greater delays and +increasing latency. + +Nevertheless, if the operator: + +* is in control of the whole GTP-U path between OsmoGGSN and the MS, and +* has Ethernet NICs supporting MTUs bigger than 1500 or uses any other link + layer supporting as well bigger MTUs. + +Then, it may be wise for the operator to configure such links with an increased +outer MTU so that they can end up transporting GTP-U inner payload of 1500 bytes +without fragmentation ocurring. + +Hence, following the examples presented on the above sections, one could +configure *all the links* which are part of the GTP-U path to use an outer MTU +of `1580` bytes, as per the following formula: + +---- +TUNNEL_MTU = ETH_MTU + GTPv1U_OVERHEAD = 1500 + 80 = 1580 bytes +---- + +.Example: Setting an MTU of `1580` to network interface `eth0` under Linux +---- +ip link set mtu 1580 dev eth0 +---- + +==== TCP MSS Clamping + +Usually endpoints use Path MTU Discovery (PMTUD) to determine the maximum MTU to +reach the peer. However, this technique may sometimes not be optimal for all +users of OsmoGGSN: + +* MS may not support requesting and/or configuring the MTU OsmoGGSN announced. +* MS may not support PMTUD on its network stack, or may not have it enabled or + may be buggy. +* Network may be misconfigured or some middlebox may be buggy (eg. not + forwarding ICMP `Packet Too Big` packets). + +Furthermore, PMTUD takes time to figure out the maximum MTU to use, since it +relies on sending data and checking if it got lost, and adapting to the fact, +reducing efficiency (throughput) of connections or even stalling them completely +when big packets are generated. + +Hence, it may become useful for the operator of OsmoGGSN to, on top of MTU +configuration, also configure its network to tune TCP Maximum Segment Size (MSS) +option of TCP connections being established over the GTPv1U tunnel. This will +make sure at least TCP connections can use the full capacity of the path MTU +without passing its imit. + +The MSS TCP option is an optional parameter in the TCP header sent during TCP +initial handshake (`SYN,SYN/ACK`) that specifies the maximum amount of bytes of +TCP payload a TCP chunk may transport. The MSS value doesn't count the +underlaying IP/TCP headers. + +Hence, following up on MTU size calculations from previous section, with a +sample GTPv1U MTU of 1420 bytes and IP header of 60 bytes, plus taking into +account that TCP header can span up to 56 bytes, we'd get to an MSS value of: + +---- +MSS = TUNNEL_MTU - IP_HDR - TCP_HDR = 1420 - 60 - 56 = 1304 +---- + +In linux, the MSS of TCP connections can be clamped using iptables: + +---- +iptables -t nat -A PREROUTING -p tcp --tcp-flags SYN,RST SYN -i apn0 -j TCPMSS --set-mss 1304 +iptables -t nat -I POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o apn0 -j TCPMSS --set-mss 1304 +ip6tables -t nat -A PREROUTING -p tcp --tcp-flags SYN,RST SYN -i apn0 -j TCPMSS --set-mss 1304 +ip6tables -t nat -I POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o apn0 -j TCPMSS --set-mss 1304 +---- + +==== Further Reading + +Check the following specs regarding MTU in 3GPP mobile networks: + +* 3GPP TS 29.061 section 11.2.1.5 +* 3GPP TS 290.060 section 13.2 IP Fragmentation +* 3GPP TS 25.414 section 6.1.3.3 +* 3GPP TS 23.060 section 9.3, Annex C +* 3GPP TS 24.008 (PCO IPv4 MTU) +* RFC 4861 (IPv6 Router Advertisement) diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc index 04c5b06..386b6b5 100644 --- a/doc/manuals/chapters/running.adoc +++ b/doc/manuals/chapters/running.adoc @@ -52,6 +52,8 @@ your distribution's documentation -- e.g. look for @net.ipv4.ip_forward=1@ in @/etc/sysctl.d/@, and https://wiki.debian.org/iptables for masquerading. +include::{srcdir}/chapters/mtu.adoc[] + === Multiple instances Running multiple instances of `osmo-ggsn` is possible if all GGSN instances -- To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/38500?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Change-Id: Ib6e974b38107fe48072380f768e1881f0fc95e80 Gerrit-Change-Number: 38500 Gerrit-PatchSet: 12 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • ...
  • 164
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.