Sharing IT Knowledge and Life – Chia sẻ kiến thức IT và đời sống

Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Monday, September 3, 2018

Java Concurrency

1. Java Concurrency from docs.oracle.com

Computer users take it for granted that their systems can do more than one thing at a time. They assume that they can continue to work in a word processor, while other applications download files, manage the print queue, and stream audio. Even a single application is often expected to do more than one thing at a time. For example, that streaming audio application must simultaneously read the digital audio off the network, decompress it, manage playback, and update its display. Even the word processor should always be ready to respond to keyboard and mouse events, no matter how busy it is reformatting text or updating the display. Software that can do such things is known as concurrent software.
The Java platform is designed from the ground up to support concurrent programming, with basic concurrency support in the Java programming language and the Java class libraries. Since version 5.0, the Java platform has also included high-level concurrency APIs. This lesson introduces the platform's basic concurrency support and summarizes some of the high-level APIs in the java.util.concurrent packages.

Java EE 7: Building Web Applications with WebSocket, JavaScript and HTML5

Purpose

how to create an application that uses the WebSocket API for real-time communication between a client and a server:
  • Create a Java Platform, Enterprise Edition 7 (Java EE 7) application that uses the WebSocket API
  • Use the OnOpen and OnMessage WebSocket lifecycle events to perform different actions on the Java EE 7 application.
  • Define a client-side WebSocket endpoint by using JavaScript
  • Operate on Plain Old Java Objects (POJOs), in real-time, with actions invoked from a web browser client

Sunday, January 7, 2018

Unstructured Supplementary Service Data (USSD)

Unstructured Supplementary Service Data (USSD), sometimes referred to as "Quick Codes" or "Feature codes", is a communications protocol used by GSM cellular telephones to communicate with the mobile network operator's computers. USSD can be used for WAPbrowsing, prepaid callback service, mobile-money services, location-based content services, menu-based information services, and as part of configuring the phone on the network.[1]
USSD messages are up to 182 alphanumeric characters long. Unlike Short Message Service (SMS) messages, USSD messages create a real-time connection during a USSD session. The connection remains open, allowing a two-way exchange of a sequence of data. This makes USSD more responsive than services that use SMS.[1]  (extract from Unstructured Supplementary Service Data).

Tuesday, August 8, 2017

Apache MINA Spring

Apache MINA (Multipurpose Infrastructure for Network Application) is an open source java network application framework. MINA is can be used to create Scalable, high performance Network applications. MINA provides unified API's for various transports like TCP, UDP, Serial communication, In-VM pipe. It also makes it easy to make an implementation of custom transport type. MINA provides both high-level and low-level network API's.
Application Structure

MINA based Application Architecture

Friday, June 23, 2017

Java DateTimeFormatter


ThingWorx: Datetime format to be used in JavaScript with parseDate
  • The format strings used by the parseDate function are based on Java's DateTimeFormatter class. 
  • Format strings used by parseDate are case sensitive.
  • Some of the common placeholders used by parseDate
    • yyyy = Year (4 digits)
    • yy = Year (2 digits)
    • MM = Month (numeric)
    • dd = Day
    • HH = Hours (24h)
    • hh = Hours (12h)
    • mm = minutes
    • ss = seconds
    • SSS = milliseconds
    • a = AM/PM
    • zzz or ZZZ = timezone
      • zzz assumes GMT with zero offset
        • parseDate(newDate , "yyyyMMddHHmmsszzz")
      • ZZZ - GMT zero offset must be explicitly set or UTC can be used
        • e.g GMT0 or UTC
        • parseDate( newDate , "yyyyMMddHHmmssZZZ")

Friday, April 14, 2017

Friday, January 1, 2016

Mobile Concept

Contents / Nội dung: English | Tiếng Việt

Mobile Concept (English)

1. What is telecommunications?

Telecommunications, also called telecommunication, is the exchange of information over significant distances by electronic means. A complete, single telecommunications circuit consists of two stations, each equipped with a transmitter and a receiver. The transmitter and receiver at any station may be combined into a single device called a transceiver. The medium of signal transmission can be electrical wire or cable (also known as "copper"), optical fiber or electromagnetic fields. The free-space transmission and reception of data by means of electromagnetic fields is called wireless.

2. Areas of telecommunications

  • Voice services (fixed, mobile, etc.), data services (e.g. ADSL), video conferencing, Internet TV, telecom network infrastructure for broadband Internet services, satellite, and other telecom/Internet products and services
  • Value-added services on the Internet and mobile phones
  • Messaging, data and entertainment services on mobile networks
  • Online games on the Internet and mobile phones
  • Trading of telecom and Internet equipment

3. More related concepts

  • Mobile communication: wireless communication that lets users make calls, send messages and access data while moving, using radio waves.
  • Cellular network: a network divided into areas called cells, each served by a base station. Neighboring cells use different frequencies so the same frequencies can be reused elsewhere.
  • Base station (BTS / NodeB / eNodeB / gNodeB): equipment with antennas that connects mobile devices to the core network (2G: BTS, 3G: NodeB, 4G: eNodeB, 5G: gNodeB).
  • Mobile generations (1G to 5G): 1G analog voice; 2G digital voice and SMS (GSM); 3G mobile Internet (UMTS/HSPA); 4G high-speed broadband (LTE); 5G very high speed, low latency and massive device connectivity.
  • SIM (Subscriber Identity Module): a card (or eSIM) that identifies the subscriber and stores authentication data for the network.
  • Roaming: using a mobile service on another operator's network, typically in another area or country.
  • Handover (handoff): transferring an ongoing call or data session from one cell to another without interruption as the user moves.
  • Spectrum / frequency band: the range of radio frequencies licensed to operators for providing services.
  • Bandwidth, throughput and latency: bandwidth is the maximum capacity of a link; throughput is the actual data rate achieved; latency is the delay of data from sender to receiver.
  • SMS / MMS: short text messages / multimedia messages (images, audio, video) over the mobile network.
  • VAS (Value-Added Services): extra services beyond basic voice and data, such as ringback tones, news by SMS, mobile payment and entertainment.
  • VoIP / VoLTE: voice over IP networks / voice calls over a 4G LTE network.
  • OTT (Over-The-Top): services delivered over the Internet without an operator's direct involvement, such as Zalo, WhatsApp, YouTube and Netflix.
  • MVNO (Mobile Virtual Network Operator): an operator that provides mobile services using another operator's network infrastructure.
  • Mobile application: software running on a mobile device. Main types: native (iOS/Android), web app (runs in the browser) and hybrid (web technology wrapped in a native shell).
  • IoT (Internet of Things): physical devices and sensors connected to the Internet, often through mobile networks.

4. Other posts related to mobile


Mobile Concept (Tiếng Việt)

1. Viễn thông là gì?

Viễn thông là việc trao đổi thông tin ở khoảng cách xa bằng các phương tiện điện tử. Một mạch viễn thông hoàn chỉnh gồm hai trạm, mỗi trạm có một bộ phát và một bộ thu. Bộ phát và bộ thu tại mỗi trạm có thể được tích hợp thành một thiết bị gọi là bộ thu phát (transceiver). Môi trường truyền tín hiệu có thể là dây dẫn điện hoặc cáp đồng, cáp quang hoặc trường điện từ. Việc truyền và nhận dữ liệu trong không gian tự do bằng trường điện từ được gọi là không dây (wireless).

2. Một số lĩnh vực hoạt động của viễn thông

  • Dịch vụ thoại (cố định, di động,..), Dịch vụ truyền dữ liệu (ví dụ ADSL), Video Conference, TiVi Internet, hạ tầng mạng viễn thông cho dịch vụ Internet băng thông rộng, vệ tinh, các sản phẩm/dịch vụ viễn thông, Internet khác
  • Dịch vụ giá trị gia tăng trên mạng Internet, điện thoại di động
  • Dịch vụ tin nhắn, dữ liệu, thông tin giải trí trên mạng điện thoại di động
  • Cung cấp trò chơi trực tuyến trên mạng Internet, điện thoại di động
  • Buôn bán thiết bị viễn thông và Internet.

3. Một số khái niệm liên quan khác

  • Thông tin di động (Mobile communication): truyền thông không dây dùng sóng vô tuyến, cho phép người dùng gọi điện, nhắn tin và truy cập dữ liệu khi di chuyển.
  • Mạng di động tế bào (Cellular network): mạng được chia thành các vùng gọi là cell, mỗi cell do một trạm gốc phục vụ. Các cell lân cận dùng tần số khác nhau để có thể tái sử dụng tần số ở nơi khác.
  • Trạm gốc (BTS / NodeB / eNodeB / gNodeB): thiết bị cùng anten kết nối thiết bị di động với mạng lõi (2G: BTS, 3G: NodeB, 4G: eNodeB, 5G: gNodeB).
  • Các thế hệ mạng di động (1G đến 5G): 1G thoại analog; 2G thoại số và SMS (GSM); 3G Internet di động (UMTS/HSPA); 4G băng thông rộng tốc độ cao (LTE); 5G tốc độ rất cao, độ trễ thấp, kết nối số lượng lớn thiết bị.
  • SIM (Subscriber Identity Module): thẻ (hoặc eSIM) định danh thuê bao và lưu thông tin xác thực với nhà mạng.
  • Chuyển vùng (Roaming): sử dụng dịch vụ di động trên mạng của nhà mạng khác, thường ở vùng hoặc quốc gia khác.
  • Chuyển giao (Handover): chuyển cuộc gọi hoặc phiên dữ liệu đang diễn ra từ cell này sang cell khác mà không bị gián đoạn khi người dùng di chuyển.
  • Phổ tần / băng tần (Spectrum): dải tần số vô tuyến được cấp phép cho nhà mạng để cung cấp dịch vụ.
  • Băng thông, thông lượng và độ trễ (Bandwidth, Throughput, Latency): băng thông là dung lượng tối đa của đường truyền; thông lượng là tốc độ dữ liệu thực tế đạt được; độ trễ là thời gian trễ của dữ liệu từ nơi gửi đến nơi nhận.
  • SMS / MMS: tin nhắn văn bản ngắn / tin nhắn đa phương tiện (hình ảnh, âm thanh, video) qua mạng di động.
  • VAS (Dịch vụ giá trị gia tăng): các dịch vụ bổ sung ngoài thoại và dữ liệu cơ bản, như nhạc chờ, tin tức qua SMS, thanh toán di động, giải trí.
  • VoIP / VoLTE: thoại qua mạng IP / cuộc gọi thoại qua mạng 4G LTE.
  • OTT (Over-The-Top): dịch vụ cung cấp qua Internet mà không cần nhà mạng trực tiếp tham gia, như Zalo, WhatsApp, YouTube, Netflix.
  • MVNO (Nhà mạng di động ảo): nhà cung cấp dịch vụ di động dựa trên hạ tầng mạng của nhà mạng khác.
  • Ứng dụng di động (Mobile application): phần mềm chạy trên thiết bị di động. Các dạng chính: native (iOS/Android), web app (chạy trên trình duyệt) và hybrid (công nghệ web đóng gói trong vỏ native).
  • IoT (Internet vạn vật): các thiết bị vật lý và cảm biến kết nối Internet, thường thông qua mạng di động.

4. Các bài viết khác liên quan tới lĩnh vực di động

Tuesday, September 13, 2011

Socket Programming

Introduction

Sockets are interfaces that can "plug into" each other over a network. Once so "plugged in", the programs so connected communicate.This article discusses only simple aspects of stream inet sockets (don't worry about exactly what that is right now). For the purposes of this article, a "server" program is exposed via a socket connected to a certain /etc/services port number. A "client" program can then connect its own socket to the server's socket, at which time the client program's writes to the socket are read as stdin to the server program, and stdout from the server program are read from the client's socket reads. This is one subset of socket programming, but it's perhaps the easiest to master, so this is where you should start.
Diagram of a simple xinetd socket usage


Diagram of client-server socket connection via xinetd.
Note that the client communicates by reading and writing the socket,
but the server program communicates via stdin and stdout.

Sunday, February 20, 2011

Saturday, December 18, 2010

Bộ giao thức TCP/IP, Ipv4, Ipv6

Ngày nay, cùng với sự phát triển mạnh mẽ của Internet, bộ giao thức nền tảng của nó là TCP/IP đã trở nên phổ biến ở mọi lúc, mọi nơi. TCP/IP phổ biến đến mức nhiều người coi đây là bộ giao thức gần như bắt buộc đối với các hệ điều hành và ứng dụng mạng hiện đại. Bài viết này giới thiệu một cách hệ thống về bộ giao thức TCP/IP, địa chỉ IPv4 và IPv6.

1. Tổng quan về TCP/IP

TCP/IP (Transmission Control Protocol/Internet Protocol) là bộ giao thức chuẩn công nghiệp, ban đầu được thiết kế cho mạng diện rộng (Wide Area Network – WAN) và hiện là bộ giao thức chuẩn của mạng Internet.

Khái niệm phân lớp giao thức đã tồn tại từ rất lâu trước khi mô hình tham chiếu 7 lớp OSI được ISO chuẩn hóa (năm 1984). TCP/IP là một ví dụ thành công của việc áp dụng khái niệm này.

Thursday, November 4, 2010

Cơ sở kỹ thuật truyền số liệu

Truyền dữ liệu

Chương 1: Khái niệm chung

Thông tin (Information)

Là sự cảm hiểu của con người về thế giới xung quanh.

Thông tin có 2 mặt:

  • Ngữ nghĩa chung.
  • Độ lớn thông tin.

Dữ liệu (Data)

Là một quá trình vật lý mang thông tin, là kết quả của phép vật chất hóa thông tin.

Dữ liệu gồm:

  1. Nội dung ngữ nghĩa của thông tin chứa trong nó.

  2. Độ lớn thông tin có trong dữ liệu.

  3. Hình thức — nội dung được thể hiện cụ thể dưới dạng dữ liệu, ví dụ: dữ liệu mã hóa, dữ liệu ở dạng dòng điện truyền đi trong dây dẫn,...

Tín hiệu (Signal)

Là một quá trình vật lý mang thông tin, phù hợp với môi trường lan truyền.

Điểm khác với dữ liệu là tín hiệu có mục tiêu làm sao để có môi trường lan truyền thông tin tốt nhất.

Ví dụ:

  • Tín hiệu sóng radio.
  • Tín hiệu điện.

Lan truyền (Transmission)

Là sự dịch chuyển một quá trình vật lý nào đó từ điểm này tới điểm khác trong môi trường lan truyền.

Có lan truyền dữ liệu, tín hiệu nhưng không có lan truyền thông tin (hiểu biết).

Truyền thông (Communication)

Là quá trình trao đổi mà vật cần trao đổi được thu nhận một cách chính xác.

Truyền dữ liệu (Data Communication)

Là quá trình truyền dữ liệu (số liệu) giữa các thiết bị.

Chú ý: Lan truyền tín hiệu là hệ con của truyền dữ liệu; truyền dữ liệu là hệ con của truyền tin.

Hệ thống truyền dữ liệu

Gồm:

  • Data Source — nguồn dữ liệu.
  • Thiết bị truyền dữ liệu.
  • Môi trường lan truyền.
  • Data Destination — điểm nhận dữ liệu.

Thiết bị đầu cuối dữ liệu (Data Terminal Equipment — DTE)

Là thiết bị nằm ở đầu hoặc cuối đường truyền dữ liệu, hoặc là nguồn dữ liệu hoặc điểm nhận dữ liệu.

Thiết bị truyền dữ liệu (Data Communication Equipment — DCE)

Là thiết bị cho phép chuyển dữ liệu thành tín hiệu hoặc ngược lại, tức thiết bị truyền hoặc nhận dữ liệu.

Môi trường lan truyền dữ liệu (đường truyền dữ liệu)

Là môi trường cho phép lan truyền tín hiệu mang dữ liệu.

Những vấn đề liên quan đến truyền số liệu

  • Lan truyền dữ liệu.
  • Mã hóa dữ liệu.
  • Các kỹ thuật truyền số liệu.
  • Các thủ tục điều khiển liên kết dữ liệu.

Mạng máy tính


Chương 2: Lan truyền dữ liệu

Máy tính là hệ vật lý cho phép lan truyền tín hiệu mang dữ liệu, nối từ máy tính phát tới máy tính thu.

Một số khái niệm

Guided Medium: Môi trường định tuyến (định hướng).

Unguided Medium: Môi trường không định tuyến (direct channel medium, undirect channel medium).

Direct Link: Liên kết (kết nối) trực tiếp.

Relay Link: Hệ thống truyền tin chuyển tiếp.

Relay Station: Trạm chuyển tiếp.

Transmission Operation: Phương thức lan truyền.

Simplex: Lan truyền một chiều.

Duplex: Lan truyền hai chiều, gồm:

  • Half-duplex.
  • Full-duplex.

Dữ liệu và tín hiệu

Digital Data: Dữ liệu số.

Analogue Data: Dữ liệu tương tự.

Digital Signal: Tín hiệu số.

Analogue Signal: Tín hiệu tương tự.

Tốc độ truyền

Baud Rate: Tốc độ tín hiệu, là số tín hiệu truyền được trong một đơn vị thời gian.

bps (bit per second): Số lượng bit truyền đi trong thời gian 1 giây.

Các dạng suy giảm và méo tín hiệu

Attenuation: Sự suy giảm tín hiệu.

Attenuation Distortion: Méo do suy giảm.

Méo tần số: Một tín hiệu có nhiều thành phần tần số.

Bandwidth: Dải thông.

Là tham số đặc trưng cho vùng truyền được của môi trường, giới hạn từ tần số nhỏ nhất đến tần số lớn nhất.

Delay Distortion: Méo pha, méo do trễ.

Non-linear Distortion: Méo phi tuyến.

Nhiễu

  • Thermal Noise: Nhiễu nhiệt.
  • Intermodulation Noise: Nhiễu điều chế lẫn nhau.
  • Interference Noise: Nhiễu giao thoa, nhiễu loạn.
  • Nhiễu xung.
  • Nhiễu Doppler.

Một số môi trường truyền thường gặp

  • Dây đồng truyền tín hiệu điện.
  • Cáp quang truyền sóng điện từ.


Chương 3: Mã hóa dữ liệu

Mô hình:

DTE → DCE → Line → DCE → DTE

Điều chế

Điều chế dải phổ

Điều chế cho phép dịch chuyển dải tần số, có thể tạo tín hiệu có khả năng miễn nhiễm với nhiễu cao hơn.

Điều chế cho phép mở rộng dải tần số của tín hiệu, cho phép lan truyền với tốc độ rất cao.

Quá trình điều chế có sử dụng một vật mang (quá trình vật lý cơ sở, đại lượng vật lý biến thiên theo thời gian). Sau đó, tín hiệu (dữ liệu) cần truyền sẽ làm biến thiên, thay đổi tham số của vật mang. Kết quả là một hỗn hợp gồm vật mang có tham số biến thiên theo dữ liệu; hỗn hợp này là một dạng tín hiệu.

Vật mang được lựa chọn sao cho dễ tạo ra và dễ thu hồi. Thông thường là dòng điện có quy luật biến thiên đều đặn hình sin hoặc xung (loại tín hiệu có biên độ được rời rạc hóa theo thời gian).

Có:

  • Điều chế hình sin.
  • Điều chế xung.

Khi truyền dữ liệu, theo ngầm định là điều chế điều hòa, có 3 tham số có thể thay đổi là A, Ω, φ.

Các phương pháp điều chế

Amplitude Modulation: Điều chế biên độ.

Frequency Modulation: Điều chế tần số.

Phase Modulation: Điều chế pha.

Duration Modulating: Điều chế độ rộng.

Điều chế số, điều chế tương tự.

Điều chế xung-mã.

Điều chế số

Điều chế mà tham số của vật mang thay đổi một cách nhảy bậc theo sự thay đổi giá trị của dữ liệu số.

Kỹ thuật dịch chuyển tham số

  • Kỹ thuật dịch chuyển biên độ, tần số, pha.
  • Amplitude Shift Keying (ASK).
  • Frequency Shift Keying (FSK).
  • Phase Shift Keying (PSK).

Chuyển dữ liệu tương tự thành dữ liệu số

Dữ liệu tương tự → dữ liệu số: phương thức mã hóa PCM (Pulse Code Modulation — điều chế xung-mã).

PCM là phương pháp chuyển dữ liệu tương tự thành một dãy xung nhị phân, trong đó mỗi nhóm xung có độ dài xác định sẽ biểu diễn một mã của phép toán giữa hai mẫu liên tiếp của dữ liệu tương tự đã được rời rạc hóa.

Giải điều chế PCM

Quá trình:

Xung → phục hồi mã → phục hồi giá trị tương tác giữa hai mẫu dữ liệu.


Chương 4: Các kỹ thuật truyền dữ liệu

Chỉ xét truyền dữ liệu số.

Kỹ thuật ghép nối dữ liệu

Bộ chuẩn ghép nối dữ liệu của truyền dữ liệu số RS-232.

Quy định về chức năng của RS-232

Gồm:

  • Nhóm tín hiệu.
  • Nhóm điều khiển.
  • Nhóm xung nhịp.
  • Các tín hiệu của nhóm đất.


Chương 5: Điều khiển liên kết dữ liệu


Nguồn: Giáo trình ĐHBK HN

POPULAR | PHỔ BIẾN

TAGS

VIEWS